Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/matritsa-qator-maksimumlari

Maximum of each row

Easy 1000 ms 128 MB 25%
Share

An integer matrix of size $n \times m$ is given. Find and print the largest element of every row.

Highlighting the largest element in each row of the matrix

Input

The first line contains two positive integers $n$ and $m$. Each of the next $n$ lines contains $m$ integers.

Output

One line with $n$ space-separated integers — the maximum of each row.

Note

$1 \le n, m \le 200$
$-1000 \le a_{i,j} \le 1000$

Examples

Input #1
2 3
1 -2 3
-4 5 6
Output #1
3 6
Input #2
3 1
5
-5
0
Output #2
5 -5 0

Sign in to submit a solution

Signing up is free and takes a minute.