Given an array A of size N of integers. Your task is to find the minimum and maximum elements in the array.
The first line of input contains an integer T denoting the number of test cases. T testcases follow. Each testcase contains 2 lines of input. The first line of each testcase contains the size of array N. The following line contains elements of the array separated by spaces.
For each testcase, print the minimum and maximum element of the array.
1 <= T <= 100
1 <= N <= 1000
1 <= Ai <=1012
3 2 1 56 10000 167
1 345 234 21 56789
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.