#include #include #define pb push_back #define Mod 1000000007 #define all(x) x.begin(),x.end() #define sz(x) ((int)x.size()) #define gcd(a,b) __gcd(a,b) #define loop(i,n) for((i)=0;(i)<(n);++(i)) #define loopr(i,a,b) for(i=(a);i<=(b);++i) #define sf(n) scanf("%d", &n) #define sf2(a,b) scanf("%d %d", &a, &b) #define sl(n) scanf("%lld",&n) #define prl(n) printf("%d\n",n) #define prs(n) printf("%d ",n) #define prll(n) printf("%lld\n",n) #define prsl(n) printf("%lld ",n) #define ios ios_base::sync_with_stdio(false) #define fillu(arr,a) memset(arr,(a),sizeof(arr)) using namespace std; typedef long long int ll; ll power(ll x, ll y){ll t;if( y == 0)return 1;t=power(x,y/2);return (y%2==0)?t*t:x*t*t;} ll powm(ll a, ll n, ll mod) {ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;} typedef vector vi; typedef vector vl; typedef map mi; typedef pair pii; int n; int check(int x, int y) { if(x>=n||y>=n||x<0||y<0) return 0; else return 1; } int main() { int i,j,k,x,y; sf(n); int arr[n][n]={0}; int vis[n][n]={0}; int ans[n][n]={0}; loopr(x,1,n-1) { loopr(y,1,n-1) { fillu(arr,0); fillu(vis,0); queue> q; q.push({-1,{0,0}}); while(!q.empty()) { //cout<<"yay"< p=q.front(); int x1=p.second.first; int y1=p.second.second; q.pop(); if(check(x1,y1)==0||vis[x1][y1]==1) continue; vis[x1][y1]=1; arr[x1][y1]=p.first+1; int step=p.first+1; q.push({step,{x1+x,y1+y}}); q.push({step,{x1-x,y1+y}}); q.push({step,{x1+x,y1-y}}); q.push({step,{x1-x,y1-y}}); q.push({step,{x1+y,y1+x}}); q.push({step,{x1-y,y1+x}}); q.push({step,{x1+y,y1-x}}); q.push({step,{x1-y,y1-x}}); //cout<<"yay"<