题目
#include<bits/stdc++.h>
using namespace std;
struct student{
string name;
int qm,py,lw;
char west,gb;
int num;
int id;
};
struct student a[110];
struct student maxn;
int n,num=0;
bool cmp1(student a){
if(a.qm>80&&a.lw>=1)return 1;
return 0;
}
bool cmp2(student a){
if(a.qm>85&&a.py>80)return 1;
return 0;
}
bool cmp3(student a){
if(a.qm>90)return 1;
return 0;
}
bool cmp4(student a){
if(a.qm>85&&a.west=='Y')return 1;
return 0;
}
bool cmp5(student a){
if(a.py>80&&a.gb=='Y')return 1;
return 0;
}
bool cmp(student a,student b){
if(a.num!=b.num)return a.num>b.num;
return a.id<b.id;
}
void work(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
cin>>a[i].name>>a[i].qm>>a[i].py>>a[i].gb>>a[i].west>>a[i].lw;
a[i].num=0;
a[i].id=i;
if(cmp1(a[i])){
a[i].num+=8000;
num+=8000;
}
if(cmp2(a[i])){
a[i].num+=4000;
num+=4000;
}
if(cmp3(a[i])){
a[i].num+=2000;
num+=2000;
}
if(cmp4(a[i])){
a[i].num+=1000;
num+=1000;
}
if(cmp5(a[i])){
a[i].num+=1000;
num+=850;
}
}
sort(a+1,a+n+1,cmp);
cout<<a[1].name<<endl;
cout<<a[1].num<<endl;
cout<<num<<endl;
}
int main(){
work();
return 0;
}