#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define wt(v) {ulong _z=v;do*--wp=_z%10+48;while(_z/=10);} #define rep(v,e) for(long v=0;v>1; long ed=st+(h<=w?h:w); rep3(y,st,ed){ src[y+1][y+1]=1; } } else{ long st=h<=w?0:w-h>>1; long ed=st+(h<=w?h:w); rep3(y,st,ed){ if(at(y,(w+h>>1)-y-1)==at(y,(w+h>>1)-y)){ src[y+1][y+1]=1; } if(at(y,(w+h>>1)-y-1)==at(y+1,(w+h>>1)-y-1)){ src[y+1][y+2]=1; } } } rrep(i,(w+h>>1)-1){ long l=i+1; l=l<=h?l:h; l=l<=w?l:w; long st=i