/*
一年義班陳律綺
成績排列
101.03.14
*/
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n;
scanf("%d",&n);
struct student //定義
{
char name[15]; //各欄位內容
char id[8];
int min,last,now;
double all;
}st[60];
int i,j;
//freopen("score.in", "r", stdin);
//freopen("score.out", "w+", stdout);
struct student y;
for(i=1;i<=n;i++)
{
scanf("%s %s %d %d %d",&st[i].name,&st[i].id,&st[i].min,&st[i].last,&st[i].now);
st[i].all=st[i].min*0.3+st[i].last*0.3+st[i].now*0.4;
}
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i;j++)
{
if(st[j].all<st[j+1].all)
{
y=st[j];
st[j]=st[j+1];
st[j+1]=y;
}
}
}
printf("\n");
for(i=1;i<=n;i++)
{
printf("%s %s %d %d %d %.2lf",st[i].name,st[i].id,st[i].min,st[i].last,st[i].now,st[i].all);
printf("\n");
}
system("pause");
return 0;
}
/*
10
Anny 10030101 98 96 95
Mary 10030102 87 65 92
Jack 10030103 99 87 100
Jemery 10030104 95 92 99
Sandy 10030105 66 52 82
Sophia 10030106 54 52 88
Anita 10030107 88 92 98
Kiki 10030108 98 92 90
Anthony 10030109 66 76 86
Rose 10030110 88 94 92
Anny 10030101 98 96 95 96.20
Jack 10030103 99 87 100 95.80
Jemery 10030104 95 92 99 95.70
Anita 10030107 88 92 98 93.20
Kiki 10030108 98 92 90 93.00
Rose 10030110 88 94 92 91.40
Mary 10030102 87 65 92 82.40
Anthony 10030109 66 76 86 77.00
Sandy 10030105 66 52 82 68.20
Sophia 10030106 54 52 88 67.00
請按任意鍵繼續 . . .
*/