I. Grid Shuffling
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
4 8
0 0 1 0
0 3 0 2
7 0 0 6
0 4 5 0
Output
4 7 3 1
5 6 2 0
0 0 0 0
0 0 0 0