#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define LL long long int #define pb push_back #define mp make_pair #define ff first #define ss second #define PII pair #define PLL pair #define VSP vector > #define PIS pair< int,string> int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ fast int t,n,i,j,x,f=0; cin>>t; vector v1,v2; while(t--) { cin>>n; int a[n][2]; v1.clear(); v2.clear(); for(x=0;x>i>>j; a[x][0]=i; a[x][1]=j; v1.pb(i); v2.pb(j); } sort(v1.begin(),v1.end()); sort(v2.begin(),v2.end()); // cout<v2[n-1] && a[x][1]v2[n-1] && a[x][1]v1[n-1] && a[x][0]v1[n-1] && a[x][0]