-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1085.cpp
More file actions
41 lines (31 loc) · 832 Bytes
/
Copy path1085.cpp
File metadata and controls
41 lines (31 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <bits/stdc++.h>
#include <string>
#define rep(i, a, b) for ( int i = (a); i <= (b); ++ i )
using namespace std;
struct node{
string id;
string name;
int a, b, c, sum;
}q[10000];
int main() {
int n;
cin >> n;
rep(i, 1, n) {
cin >> q[i].id >> q[i].name >> q[i].a >> q[i].b >> q[i].c;
q[i].sum = q[i].a + q[i].b + q[i].c;
}
int max;
rep(i, 1, n) {
if ( q[i].sum > q[max].sum ) max = i;
}
double aa = 0, bb = 0, cc = 0;
rep(i, 1, n) {
aa += q[i].a;
bb += q[i].b;
cc += q[i].c;
}
aa /= n, bb /= n, cc /= n;
printf("%.0lf %.0lf %.0lf\n", aa, bb, cc);
cout << q[max].id << ' ' << q[max].name << ' ' << q[max].a << ' ' << q[max].b << ' ' << q[max].c;
return 0;
}