problem
solution
codes
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
struct node{
int id; string name;
int end, peace, paper;
char cadre, west;
int ans;
bool operator < (const node &x)const{
return ans==x.ans ? id<x.id : ans>x.ans;
}
}a[110];
int tot;
int main(){
int n; cin>>n;
for(int i = 1; i <= n; i++){
a[i].id = i;
cin>>a[i].name>>a[i].end>>a[i].peace>>a[i].cadre>>a[i].west>>a[i].paper;
if(a[i].end>80 && a[i].paper>=1)a[i].ans += 8000;
if(a[i].end>85 && a[i].peace>80)a[i].ans += 4000;
if(a[i].end>90)a[i].ans += 2000;
if(a[i].west=='Y' && a[i].end>85)a[i].ans += 1000;
if(a[i].peace>80 && a[i].cadre=='Y')a[i].ans += 850;
tot += a[i].ans;
}
sort(a+1,a+n+1);
cout<<a[1].name<<"\n"<<a[1].ans<<"\n"<<tot<<"\n";
return 0;
}