dummy-15

You are given a sequence of numbers. You can change any number from the sequence to any other number of your choice. Your task is to minimize the number of numbers changed in order to make the sequence strictly increasing.

Input:

The first line of input is an integer T(T ≤ 5), the number of test cases. Each test case contains 2 lines.
The first line of the test case contains an integer (0 < N ≤ 10^5), i.e. the number of elements in the sequence.
The second line contains N positive integers, no larger than 2*10^9, which forms the sequence.

Output:

For each test case output the minimal number of elements you must change in the given sequence to get the desired one.

SAMPLE INPUT
4
2
1 2
3
3 2 1
5
10 5 6 7 8
4
2 2 2 2

SAMPLE OUTPUT
0
2
1
3

Explanation

For the 1st test case, you don't need to change any elements.
For the 4th test case, you can change the last three 2s into 3,4 and 5.

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: