#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
struct STU{
char name[10+1];
int num;
int time;
};
int main(){
int C, N;
while( scanf("%d", &C) != EOF ){
while( C-- ){
scanf("%d", &N);
STU res = {"", -1, 100001};
STU t;
while( N-- ){
scanf("%s %d %d", t.name, &t.num, &t.time);
if( t.num > res.num )
res = t;
else if( t.num==res.num && t.time<res.time ){
res = t;
}
}
printf("%s %d %d\n", t.name, t.num, t.time);
}
}
return 0;
}![图片说明](https://img-ask.csdn.net/upload/201812/10/1544456555_268397.png)![图片说明](https://img-ask.csdn.net/upload/201812/10/1544456570_23890.png)
1