import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public int i,j; public Solution(int a,int b){ i=a; j=b; } public static int check(int[][] arr, HashSet numberpairs,int a,int b,int n,int count){ count++; HashSet newPairs= new HashSet(); for(Solution p:numberpairs){ int i=p.i; int j=p.j; if(i+a=0 && j+b=0 && arr[i+a][j-b]!=1){ newPairs.add(new Solution(i+a,j-b)); arr[i+a][j-b]=1; } if(i-a>=0 && j-b>=0 && arr[i-a][j-b]!=1){ newPairs.add(new Solution(i-a,j-b)); arr[i-a][j-b]=1; } if(i+b=0 && j+a=0 && arr[i+b][j-a]!=1){ newPairs.add(new Solution(i+b,j-a)); arr[i+b][j-a]=1; } if(i-b>=0 && j-a>=0 && arr[i-b][j-a]!=1){ newPairs.add(new Solution(i-b,j-a)); arr[i-b][j-a]=1; } } if(count>n*n){ return -1; } else if(arr[0][0]==1){ return count; } else{ return check(arr,newPairs,a,b,n,count); } } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); // int i=n,j=n; // Solution s= new Solution(); // HashSet newPasirs= new HashSet(); int answer[][]=new int[n-1][n-1]; for(int i=1;i newPairs= new HashSet(); newPairs.add(new Solution(n-1,n-1)); answer[i-1][j-1]=answer[j-1][i-1]=check(a,newPairs,i,j,n,0); } } for(int i=0;i