#include #include #include #include #include #include #include #include #include #include using namespace std; #define INF 0x3f3f3f3f #define MAXN 110 struct Node { string na; int v[MAXN]; int cv; } a[MAXN]; int cmp(int a,int b)//结构体排序 { return a>b;//对价值降序排列 } int main() { #ifdef ONLINE_JUDGE #else freopen("F:/cb/read.txt","r",stdin); //freopen("F:/cb/out.txt","w",stdout); #endif ios::sync_with_stdio(false); cin.tie(0); int t; cin>>t; while(t--) { int n,k=0,ans=0; string s; int temp; cin>>n; for(int i=0; i>s>>temp; for(int j=0; j