BETA
Successful submissions of School Problems are not counted in user ratings.

Submissions : 776 Accuracy :

33.12

Find minimum and maximum element in an array
     

Given an array of integers.Your task is to find the minimum and maximum element in array.
Input:
The first line of input contains an integer T denoting the number of test cases. Each test case contains an integer n denoting the size of the array. Then following line contains 'n' integers forming the array.

Output:
Print the minimum and maximum element of array.

Constraints:
1<=T<=100
1<=n<=1000
1<=a[i]<=10^12

Example:
Input:
2
6
3 2 1 56 10000 167
5
1 345 234 21 56789
Output:
1 100000
1 56789

**For More Examples Use Expected Output**


Contributor: Shubham Chaudhary

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



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