package no217; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][] ans; if (n % 2 == 1) { ans = odd(n); }else if((n / 2) % 2 == 0) { ans = even1(n); }else{ ans = even2(n); } StringBuilder sb = new StringBuilder(); for(int i=0;i 0) { sb.append(' '); } sb.append(ans[i][j]); } sb.append('\n'); } System.out.print(sb.toString()); } public static int[][] odd(int n) { int[][] m = new int[n][n]; int i = n - 1; int j = n / 2; for(int t=0;t= n + 3) { num++; } if (i / 2 % 2 == 0) { m[i][0] = num; }else{ m[i][n-1] = num; } } for(int i=1;i