#P3972. 1 M possible
1 M possible
Problem Description
There are 3*N+2 nonnegative integers. Except two special integers, the rest 3*N integers can form N triple groups: { Vi, Vj, Vk| Vi=Vj=Vk}, each integer are at most in one triple group.
Your task is to find the two special integers.
Now, suneast is so boring. He wants to compete with you. As there is no computer available for him, he has to find the integers use his eyes! Unbelievable! So just for fairness, your program can access ONLY 1MB memory!
Tips: Impossible itself says 1 M possible ------ Tourist’s quote (a topcoder target member)
Input
The first line of the input contains an integer T(T<=3), indicating the number of test cases.
Each case begin with a line containing an integers N(2<=N<=300000, N=2(mod3) ).
The second lines contains N nonnegative integers Vi (1<=Vi<=2147483647).
Output
For each test case, print a line containing two integers a, b (a<=b) separate by a blank. a, b is the desire two special integers.
2
2
1 2
23
1 3 1 4 5 2 1 1 3 1 4 5 2 1 1 3 1 4 5 2 1 2 1
1 2
1 2
Author
isuneast