解析:
红色放奇数即可
#include<bits/stdc++.h>
using namespace std;
//#define int long long
const int N=2e3+5;
int n;
void solve(){
scanf("%d",&n);
int a=1,b=2;
for(int i=1;i<=n/2;i++){
for(int j=1;j<=n/2+1-i;j++){
printf("%d ",b);
b+=2;
}
for(int j=1;j<=i*2-1;j++){
printf("%d ",a);
a+=2;
}
for(int j=1;j<=n/2+1-i;j++){
printf("%d ",b);
b+=2;
}
printf("\n");
}
for(int i=1;i<=n;i++){
printf("%d ",a);
a+=2;
}
for(int i=n/2;i>=1;i--){
printf("\n");
for(int j=1;j<=n/2+1-i;j++){
printf("%d ",b);
b+=2;
}
for(int j=1;j<=i*2-1;j++){
printf("%d ",a);
a+=2;
}
for(int j=1;j<=n/2+1-i;j++){
printf("%d ",b);
b+=2;
}
}
}
signed main(){
int t=1;
// scanf("%lld",&t);
while(t--) solve();
return 0;
}