eolymp
bolt
Try our new interface for solving problems
Problems

Rows with maximum sum

Rows with maximum sum

A two-dimensional array of size $n \cdot m$ is given. Find the rows in which the sum of the elements is the maximum. \InputFile The first line contains two numbers $n$ and $m$ --- the number of rows and columns. Then given $n$ rows of $m$ integers --- the elements of array. All numbers do not exceed $100$ by absolute value. Numbering in the array starts with $1$. \OutputFile Print in one line the numbers of the rows where the sum of elements is maximum.
Time limit 1 second
Memory limit 128 MiB
Input example #1
4 5
1 2 3 4 5
8 2 3 4 5
6 3 4 4 5
1 2 3 4 5
Output example #1
2 3