// codesnip-guard: syakutori #[cfg_attr(any(),rustfmt::skip)]mod syakutori{#[doc=" arg:"]#[doc=" - n: length of array"]#[doc=" - (l, r): ident of left-bound and right-bound"]#[doc=" - addable: |index| expr: return is addable element"]#[doc=" - add: |index| expr: add element"]#[doc=" - remove: |index| expr: remove element"]#[doc=" - show: call n times for l in 0..n, with rightmost r"]#[doc=""]#[doc=" ```"]#[doc=" # use competitive::syakutori;"]#[doc=" let (a, w) = ([1, 2, 3, 4], 6);"]#[doc=" let (mut ans, mut acc) = (0, 0);"]#[doc=" syakutori!("]#[doc=" a.len(),"]#[doc=" (l, r),"]#[doc=" |i| acc + a[i] <= w,"]#[doc=" |i| acc += a[i],"]#[doc=" |i| acc -= a[i],"]#[doc=" ans += r - l"]#[doc=" );"]#[doc=" assert_eq!(ans, 7);"]#[doc=" ```"]#[macro_export]macro_rules!syakutori{($n:expr,($l:ident,$r:ident),|$i:ident|$addable:expr,|$j:ident|$add:expr,|$k:ident|$remove:expr,$show:expr$(,)?)=>{{let n:usize=$n;let mut$r:usize=0;for$l in 0..n{while$r