#include<bits/stdc++.h> using namespace std; int n; struct Node{ int no; double ps; }a[105]; bool cmp(Node a,Node b){ return a.ps>b.ps; } int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i].no; int c[5]; for(int j=0;j<=4;j++) cin>>c[j]; sort(c,c+5); a[i].ps=(c[1]+c[2]+c[3])*1.0/3; } sort(a+1,a+n+1,cmp); for(int i=1;i<=3;i++){ printf("%d %.3f\n",a[i].no,a[i].ps); } return 0; } /************************************************************** Problem: 1315 User: lidongcheng Language: C++ Result: Accepted Time:17 ms Memory:2080 kb ****************************************************************/