#include "stdio.h" #include "stack" #include "map" #include "queue" #include "string" #include "math.h" #include "string.h" #include "iostream" #include "algorithm" #define N 1000 #define LL long long #define inf 0x7ffffff #define pi 3.1415926535897932384626433832795028841971 using namespace std; struct dd { char name[111]; int year; }p[N]; int cmp(dd a,dd b) { return a.year>b.year; } int main() { int t,i,n,j,num,l; char s[N]; scanf("%d",&t); while(t--) { scanf("%d",&n); getchar(); for(i=0;i