BETA
School Problem's Submission isn't counted in score!

Total Submissions: 1514 Accuracy:

37.25%

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 Input/Output Examples Use 'Expected Output' option **

Contributor: Shubham Chaudhary

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.