Last active
July 27, 2016 16:05
-
-
Save ravikiran0606/c6f059ca1084b28861dbad72c28b668c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
ios_base::sync_with_stdio(false); | |
cin.tie(0); | |
cout.tie(0); | |
int t,x,y; | |
map<int,int>m1,m2; | |
long int n,i; | |
cin>>t; | |
while(t--){ | |
cin>>n; | |
for(i=0;i<n;i++){ | |
cin>>x>>y; | |
m1[x]++; | |
m2[y]++; | |
} | |
int ans=min(m1.size(),m2.size()); | |
cout<<ans<<endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment