第一题:
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, m;
int sum = 0, maxi, ans = 0, cnt;
scanf(“%d%d”, &n, &m);
int x;
for (int i = 1; i <= n; i++)
{
maxi = 0;
for (int j = 1; j <= m+1; j++)
{
scanf(“%d”, &x);
sum += x;
if (j != 1)
maxi += (-x);
}
if (maxi > ans)
ans = maxi, cnt = i;
}
printf(“%d %d %d”,sum,cnt,ans);
return 0;
}