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).
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.
Print an integer which denotes the minimum element in the array.
1 <= T <= 100
1 <= N <= 107
1 <= arr[i] <= 107