Special Number

3

3 votes
Easy, Easy
Problem

Consider an array A of size N and array B of size N+1. A special number is number which if removed from B or added to A makes both arrays equal. Two arrays are said to be equal if after sorting both of them(in increasing order),they are exact replicas of each other.Find that special number.

INPUT:

First line contains T denoting test cases. For each test case, first line contain single integer N as mentioned in problem statement. Following N lines contain integers describing A. Next N+1 lines contain integers describing B.

OUTPUT:

For each test case, output single integer denoting special number in a new line. (If there are multiple special numbers, print any of them.)

Note: It is guaranteed that at least one special number exists.

CONSTRAINTS:

T<=10

1<=N<=10^5

0<=A[i],B[i]<=10^18

Sample Input
1 
3
1
2 
3
1 
2 
3 
4
Sample Output
4
Time Limit: 0.3
Memory Limit: 256
Source Limit:
Editor Image

?