1178: 矩阵最大和

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:11 Solved:8

Description

在N行M列的正整数矩阵中,要求从每行中选出1个数,使得选出的总共N个数的和最大。

Input

第一行两个数字  1 < N <= 1000, 0 <= M < = 10000;
后面N行,每行M个数字

Output

满足条件的最大和。

Sample Input Copy

4 3
12 9 1
2 4 7
3 3 9
6 7 3

Sample Output Copy

35

Source/Category