mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
14 lines
287 B
C++
14 lines
287 B
C++
|
#include <stdio.h>
|
||
|
int main(){
|
||
|
int n,m,i,j;
|
||
|
scanf("%d",&n);
|
||
|
while(n-->0){
|
||
|
scanf("%d",&m);
|
||
|
for(i=0;i<m;i++){
|
||
|
for(j=0;j<m;j++)
|
||
|
printf("%4d",(i+j-m/2+m)%m*m+(m+i+2*j-m+1)%m+1);
|
||
|
printf("\n");
|
||
|
}
|
||
|
}
|
||
|
}
|