시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 16 | 6 | 6 | 37.500% |
Many people know about magic squares --- squares that contain distinct numbers and have equals sums of rows and columns. Recently Eve has heard about magic squares, and now she has invented her own version: elegant squares.
Eve calls a square of $n\times n$ integers elegant if the following conditions are satisfied:
For example, the picture below shows an elegant $3 \times 3$ square.
$$ \begin{matrix} 1& 21& 10\\ 6& 5& 7\\ 35& 2& 3 \end{matrix} $$
All of its entries are distinct positive square free integers, and product of any row and any column is 210.
Help Eve, find an $n \times n$ elegant square. All numbers in the square must not exceed $10^{18}$. It is guaranteed that for the given constraints there exists such square.
The input file a single integer $n$ ($3 \le n \le 30$).
Output $n \times n$ integers: the found elegant square. All printed integers must not exceed $10^{18}$.
3
1 21 10 6 5 7 35 2 3