#include #include #include #include using namespace std; int Tn,N,i,fl; paira[100005]; int main (int argc, char * const argv[]) { ios_base::sync_with_stdio(0); cin>>Tn; for(;Tn;Tn--){ cin>>N; for(i=1;i<=N;i++)cin>>a[i].second>>a[i].first; sort(a+1,a+N+1); // sort all the players for(fl=0,i=1;i<=N;i++){ fl=0; // in order to check the uniqueness in the sorted list is just sufficient to check two neighbors if(i==1||a[i].first!=a[i-1].first)fl+=1; if(i==N||a[i].first!=a[i+1].first)fl+=2; if(fl==3){ // if the number if unique, then it's a result cout<