시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 512 MB | 1 | 1 | 1 | 100.000% |
Given a rectangular array $a$ of size $n \times m$ and a prime number $p$, find two rectangular arrays, $b$ of size $K \times n$ and $c$ of size $K \times m$, such that:
The first line of input contains four positive integers $n$, $m$, $K$, $p$ ($1 \le n \cdot m, K \cdot n, K \cdot m \le 10^5$; $2 \le p \le 10^9 + 7$; $p$ is prime).
The $i$-th of the following $n$ lines contains $m$ integers $a_{i,1}, a_{i,2}, \ldots, a_{i,m}$ ($0 \le a_{i,j} < p$).
If there is no solution, output a line "No solution!
".
Otherwise, output $K$ lines, $i$-th of which contains $n + m$ integers $b_{i,1}, b_{i,2}, \ldots, b_{i,n}, c_{i,1}, c_{i,2}, \ldots, c_{i,m}$.
If there are several possible answers, print any one of them.
1 1 1 97 0
No solution!
3 3 1 97 1 2 3 2 4 6 3 6 9
1 2 3 1 2 3