Richest Row
Print the 1-based index of the row with the largest sum (smallest index on ties).
Input: the first line has N and M; the next N lines each have M integers.
Output: the index of the richest row.
Constraints:
- 1 ≤ N, M ≤ 100
- −104 ≤ values ≤ 104
Sample Tests
Input 1
2 3 1 2 3 3 2 2
Output 1
2
Input 2
1 1 -5
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.