We have N cards with each card numbered from 1 to N. All cards are randomly shuffled. We are allowed only operation moveCard(N) which moves the card with value N to the top of the pile. You are required to find out the minimum number of moveCard() operations required to sort the cards in increasing order.

Input:
The first line contains a positive integer T denoting the number of test cases. Each of the test case consists of 2 lines. The first line of each test case contains a single integer N. Next line contains space separated sequence of N integers.â€‹

Output:
For each test case, print in new line the minimum number of operations required.â€‹

Constraints:
1 <= T <= 10^{2}
1 <= N <=10^{7}
1 <= A[i] <= Nâ€‹