#include #include #include #include #define coor(i,j) ((i)+(j)*m) #define in(i,j) (0<=(i)&&(i) > M(100); int main(){ int n,d,w; int i,j; cin>>n; for(i=0;i>d; M[i][(i+d)%n]=1; M[i][(i-d+n*1000)%n]=1; } for(i=0;i>w; M[i][n]=w^1; } int k=0; for(i=0;i