BETA

Difficulty Level: Easy

Submissions: 8237 Accuracy:

23.1%

Two numbers with sum closest to zero
     

Given an integer array, you need to find the two elements such that their sum is closest to zero.
 
Input:
The first line of input contains an integer T denoting the number of test cases.  
The first line of each test case is N,the size of array
Each test case consist of a N integers which are the array elements.
 
Output:
Print the two numbers in ascending order such that their sum is closest to zero.
 
Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 1000
-100007 ≤ a[i] ≤ 100007
 
Example:
Input

3
3
-8 -66 -60  
6
-21 -67 -37 -18 4 -65  
2
-24 -73  
 
Output
-60 -8
-18 4
-73 -24

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.