// tabun TLE suru char pc[1<<19]; unsigned bs[19]; bool pari(unsigned g,unsigned b){ bool z=false,y=false; while(b){ if(b&1){ if(g&1){ z^=y; }else{ y=!y; } } g>>=1; b>>=1; } return z; } pair f(int s,unsigned b :Memoize[19,524288]){ pair z{}; int d=pc[b]; if(d==1){ z.first=b&bs[s]?1:0; }else{ int e=d>>1; for(unsigned g=b;g=g-1&b;){ if(pc[g]==e){ auto r1=f(s,g); auto r2=f(s+e,b^g); if(pari(g,b)){ z.first+=r1.first*r2.second+r1.second*r2.first; z.second+=r1.first*r2.first+r1.second*r2.second; }else{ z.first+=r1.first*r2.first+r1.second*r2.second; z.second+=r1.first*r2.second+r1.second*r2.first; } } } } return z; } { rep(i,1<<19){ pc[i]=__builtin_popcount(i); } rep(i,19){ ll@l; rep(l){ ll@a; bs[i]|=1<