A sorted array arr[] of size N which is rotated at some unknown point. The task is to find the minimum element in it. All the elements in the array are distinct.

Note: Expected time complexity is O(logN).

Input:
The first line of input contains an integer T denoting the number of test cases. Each test case contains the number of elements in the array arr[] as N and next line contains space separated n elements in the array arr[].

Output:
Print an integer which denotes the minimum element in the array.

Constraints:
1 <= T <= 100
1 <= N <= 10^{7}
1 <= arr[i] <= 10^{7}