-
Notifications
You must be signed in to change notification settings - Fork 0
/
PTMSSNG.cpp
46 lines (41 loc) · 969 Bytes
/
PTMSSNG.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//Problem link - https://www.codechef.com/JULY20B/problems/PTMSSNG
#include<bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define lli long long int
#define vi vector<int>
#define vll vector<lli>
#define pb push_back
#define all(v) v.begin(),v.end()
void solve(){
int n,i,x,y;
cin >> n;
map<int, int> mpx,mpy;
rep(i,4*n-1){
cin >> x >> y;
mpx[x]++;
mpy[y]++;
}
map<int, int>::iterator it;
for(it=mpx.begin(); it!=mpx.end(); it++){
if(it->second % 2 != 0) x = it->first;
}
for(it=mpy.begin(); it!=mpy.end(); it++){
if(it->second % 2 != 0) y = it->first;
}
cout << x << " " << y << endl;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int test_cases;
//test_cases = 1;
cin >> test_cases;
while(test_cases--){
solve();
}
return 0;
}