#109Medium
Remove the minimum's column
Time: 1 s · Memory: 256 MB
- Matrices
Statement
You are given an matrix. Remove the column that contains its smallest element. If there are several minimums, remove the column of the first one in row order (left to right, top to bottom).
Input format
The first line contains and (, ). The next lines contain the matrix ().
Output format
lines with numbers each — the changed matrix.
Examples
Input
3 3 1 2 3 4 5 6 7 8 9
Output
2 3 5 6 8 9
Input
3 3 9 2 8 4 1 6 7 5 1
Output
9 8 4 6 7 1
Note
First find the column of the minimum over the whole matrix (update only on a strictly smaller value so that the first one stays), then print every row without that column. In the second example occurs twice; the first is in column 2.
