-
Notifications
You must be signed in to change notification settings - Fork 0
/
AB.cpp
42 lines (42 loc) · 900 Bytes
/
AB.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
/*Shuvro Das*/
#include<bits/stdc++.h>
#define ls long long singed
#define ll long long int
#define fr for (int i=0; i<n; i++)
#define pf printf
#define dl double
using namespace std;
int main()
{
ll n, i, j, k;
cin>>n;
ll a[n], b[n], c[n];
for(i=0; i<n; i++) cin>>a[i];
for(i=0; i<n-1; i++) cin>>b[i];
for(i=0; i<n-2; i++) cin>>c[i];
sort(a, a+n);
sort(b, b+n-1);
sort(c, c+n-2);
bool flag=false;
ll ans;
for(i=0; i<n-1; i++){
if(a[i]!=b[i]){
flag=true;
ans=a[i];
break;
}
}
if(!flag) ans=a[n-1];
flag=false;
cout<<ans<<endl;
for(i=0; i<n-2; i++){
if(b[i]!=c[i]){
flag=true;
ans=b[i];
break;
}
}
if(!flag) ans=b[n-2];
cout<<ans<<endl;
return 0;
}