#include #include #include #include #define ulong unsigned long long using namespace std; int mat[25][25]; int n; void setter(int i,int j,int mov,int x,int y){ if(i < 0 || j < 0) return; if(i >= n || j >= n ) return; if(mat[i][j] > mov || mat[i][j]==0 ) mat[i][j] = mov; else return; setter(i+x,j+y,mov+1,x,y); setter(i-x,j+y,mov+1,x,y); setter(i+x,j-y,mov+1,x,y); setter(i-x,j-y,mov+1,x,y); setter(i+y,j+x,mov+1,x,y); setter(i-y,j+x,mov+1,x,y); setter(i+y,j-x,mov+1,x,y); setter(i-y,j-x,mov+1,x,y); } void putter(int i,int j){ cout<>n; int ans[n][n]; for (int i = 1; i < n; i++) { for (int j = 1; j < n; j++) { resetter(); if(i >= j){ setter(0,0,1,i,j); ans[i][j] = (mat[n-1][n-1]) - 1; ans[j][i] = ans[i][j]; } } } for (int i = 1; i < n; ++i) { for (int j = 1; j < n; ++j) { cout<