#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>n; Int k=n/2; // n = 2k + 1 if(n&1){ assert(0); }else{ Int num=1; for(Int i=0;i=0;j--){ st[i][j]=num++; st[(i+k)%n][j+k]=num++; } } } } for(Int i=0;i