#P1418. [TJOI2011] 构造矩阵
[TJOI2011] 构造矩阵
Description
Construct an matrix such that the number of s in each row is , and the number of s in each column is .
Among all valid matrices, the result should be lexicographically smallest. When comparing two matrices in lexicographical order, first compare the first row; if they are equal, compare the second row; and so on.
Input Format
The first line contains two integers .
The second line contains integers .
The third line contains integers .
Output Format
Output an matrix.
2 3
2 1
1 0 2
101
001
Hint
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号