Blind Gauss
시간 제한1초메모리 제한2048 MB
행렬식이 1이고 i번째 행에 홀수가 정확히 a_i개 있는 n×n 음이 아닌 정수 행렬을 만들거나, 불가능하면 -1을 출력한다.
문제
Construct a square matrix with rows and columns consisting of nonnegative integers from to such that its determinant is equal to and there are exactly odd numbers in the -th row for each from to , or report that there is no such matrix.
입력
The first line contains a single integer ().
Each of the next lines contains a single integer ().
출력
If there is no matrix that meets the requirements, output -1.
Otherwise, output lines with numbers in each (): the elements of the constructed matrix. If there are multiple solutions, print any one of them.