Magic square is an $n$ by $n$ square grid where each cell of the grid contains distinct integers in the range
$1, 2, \cdots, n^ 2$ , and the sum of each row, column and diagonal is equal.
To create an $n$ by $n$ magic square($n$ is odd), you have to fill in $1, 2, \cdots, n^ 2$ accordingly with the following steps:
A positive odd integer $n(n\leq1001)$
An $n\times n$ magic square which is generated by the previous steps. Notice that integers in the same row are separated by a single white space, and each row should end with a new line character(‘\n’).
No. | Testdata Range | Score |
---|---|---|
1 | 0~5 | 100 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1000 | 65536 | 65536 | |
1 | 1000 | 65536 | 65536 | |
2 | 1000 | 65536 | 65536 | |
3 | 1000 | 65536 | 65536 | |
4 | 1000 | 65536 | 65536 | |
5 | 1000 | 65536 | 65536 |