import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void calculate(int n, int a, int b, int curx, int cury, int[][] grid, int curval) { // if(curx==n-1 && cury==n-1 && curval==0){ int newx,newy; newx=curx-a;newy=cury-b;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx-a;newy=cury+b;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx+a;newy=cury-b;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx+a;newy=cury+b;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx-b;newy=cury-a;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx-b;newy=cury+a;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx+b;newy=cury-a;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} newx=curx+b;newy=cury+a;if(newx>=0 && newy>=0 && newxgrid[curx][cury]+1)){grid[newx][newy]=grid[curx][cury]+1;calculate(n,a,b,newx,newy,grid,curval+1);} // } } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int i,j; for(i=1;i