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

~/algor $ cat problems/matritsa-eng-katta-yigindili-qator

Row with the largest sum

Easy 1000 ms 128 MB 25%
Share

An integer matrix of size $n \times m$ is given. Find the number of the row whose elements have the largest sum (numbering starts at $1$) and that sum. If there are several such rows, take the topmost one.

Choosing the row with the largest sum of elements

Input

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

Output

One line with two space-separated integers: the row number and its sum.

Note

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

Examples

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

Sign in to submit a solution

Signing up is free and takes a minute.