| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 27 | 6 | 5 | 20.000% |
Construct a square matrix with $n$ rows and $n$ columns consisting of nonnegative integers from 0ドル$ to 10ドル^{18}$ such that its determinant is equal to 1ドル$ and there are exactly $a_i$ odd numbers in the $i$-th row for each $i$ from 1ドル$ to $n,ドル or report that there is no such matrix.
The first line contains a single integer $n$ (2ドル \le n \le 50$).
Each of the next $n$ lines contains a single integer $a_i$ (1ドル \leq a_i \leq n$).
If there is no matrix that meets the requirements, output -1.
Otherwise, output $n$ lines with $n$ numbers $m_{i,j}$ in each (0ドル \leq m_{i,j} \leq 10^{18}$): the elements of the constructed matrix. If there are multiple solutions, print any one of them.
2 1 1
1 0 0 1
2 2 1
1 1 1 2
4 3 3 3 3
1 0 1 1 1 1 1 2 1 1 2 3 0 1 1 3
3 2 2 2
-1
3 3 1 3
-1