include[HTML_REMOVED]
using namespace std;
int n,N[40][40];
int main(){
scanf(“%d”,&n);
N[1][n/2+1]=1;
int x=1,y=n/2+1;
for(int a=2;a<=n*n;a){
if(x==1 && y!=n){
x=n;
y;
}
else if(x!=1 && y==n){
y=1;
x–;
}
else if(x==1 && y==n){
x;
}
else if(N[x-1][y+1]==0){
x–;
y;
}
else{
x;
}
N[x][y]=a;
}
for(int z=1;z<=n;z){
for(int p=1;p<=n;p++){
printf(“%5d”,N[z][p]);
}
printf(“\n”);
}
return 0;
}