26 lines
514 B
C++
26 lines
514 B
C++
|
|
#include <bits/stdc++.h>
|
|||
|
|
|
|||
|
|
using namespace std;
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
20190925
|
|||
|
|
csp试题1:小明种苹果
|
|||
|
|
*/
|
|||
|
|
int main() {
|
|||
|
|
int n, m;
|
|||
|
|
cin >> n >> m;
|
|||
|
|
int f = 0, sum = 0, ma = 0;
|
|||
|
|
for (int i = 1, a; i <= n; i++) {
|
|||
|
|
cin >> a;
|
|||
|
|
sum += a;
|
|||
|
|
int ans = 0;
|
|||
|
|
for (int j = 1, x; j <= m; j++) {
|
|||
|
|
cin >> x;
|
|||
|
|
ans += x;
|
|||
|
|
}
|
|||
|
|
ans = -ans;
|
|||
|
|
sum -= ans;
|
|||
|
|
if (ma < ans) ma = ans, f = i;
|
|||
|
|
}
|
|||
|
|
cout << sum << " " << f << " " << ma;
|
|||
|
|
}
|