#102Easy
Column maximums
Time: 1 s · Memory: 256 MB
- Matrices
Statement
You are given an matrix. Find the largest element of each column.
Input format
The first line contains and (). Each of the next lines contains integers ().
Output format
A single line with numbers: the -th is the maximum of column .
Examples
Input
3 3 1 2 9 4 8 6 7 5 3
Output
7 8 9
Input
2 2 -5 -1 -3 -7
Output
-3 -1
Note
To walk down a column, the outer loop goes over columns () and the inner loop over rows (): element . Start from the first element of the column, not from (all numbers are negative in the second example).
