gem-division

Raaju and Ankit went on an adventurous trip to the Old Ruins of Al Kharid. There they somehow ran into an old precious pot of gems. Now they need to divide gems among them. But soon they realize that it might not be possible for them to do this fairly. So they go to the Old Monk of Al Kharid and ask his help. The monk proposes them that he will charge one gem and help them with their division. In total they have N gems. The ith gem has value Vi.
            The monk is a not very selfish so he will take the gem which will help him distribute the rest of N-1 gems fairly among the two so that the difference between total values they both recieve is minimized. Now you wonder what that division could be. Your task is to find out the same.

Input :
            First line contains a integer T, denoting the number of test cases.
            Each test case consists of two lines.
            First line of each test case contains a single integer N.
            Second line of each test case contains N space separated integers denoting the value(Vi) of each gem.

Output :
            For each test case, print two integers in a single line separated by space. The first integer denotes the difference in the values recieved by Raaju and Ankit. The second integer denotes the value of gem taken by the Old Monk. In case there exist multiple values for Old Monk, Old monk takes the one with the least value.

Constraints :
            1 ≤ T ≤ 100
            1 ≤ N ≤ 50
            1 ≤ Vi ≤ 100SAMPLE INPUT
3
2
100 5
3
1 2 1
5
5 3 1 2 4

SAMPLE OUTPUT
5 100
0 2
0 1

Explanation

For test case 1, Monk takes the gem with value 100 and gives the gem with value 5 to any one of the two. The difference in values recieved by two is 5 - 0 = 5.
For test case 2, Monk takes the gem with value 2 and gives both of them one gem each having value one. The difference is 1 - 1 = 0.

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: