7718: Find the rows with most 1's

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:2 解决:2

题目描述

Given a 2D matrix, which contains only 0's and 1's, find the first row with most 1's.

输入

多组测试。每一组第一行是行数M和列数N. It follows M lines, each having N numbers (only 0's and 1's). There is a space between every 2 numbers.


输出

每组输出结果占一行


样例输入 复制

2 3

1 0 1

0 0 1

3 4

1 0 0 0

1 1 0 0

0 0 0 0

0 0 0 1

样例输出 复制

0
1

提示

What if the matrix contains only 0's?


Write the optimal solution.