LogiQuest

303. Row with Maximum Sum

EasyMatrix

Print the 1-based index of the row with the largest sum and that sum. If several tie, choose the first.

Input format

Line 1: r c Next r lines: c integers

Output format

row sum

Example 1

Input

3 3
1 2 3
4 5 6
7 8 9

Output

3 24

Example 2

Input

2 2
5 5
6 4

Output

1 10

Constraints

1 ≤ r, c ≤ 500

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…