#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a; vector res(22); BS all(0); for(int i=0;i>(a%MAX); tmp|=(res[p/MAX]&(all>>(MAX-(b-p))))<<(p-a); }else{ tmp|=(res[a/MAX]>>(a%MAX))&(all>>(MAX-(b-a))); } int q=(c/MAX+1)*MAX; res[c/MAX]^=tmp<<(c%MAX); res[q/MAX]^=tmp>>(q-c); } for(int i=0;i