You are given a sequence f satisfies that fi != fj, you have an operation: swap(fi, fj) and cost you 1 Yuan, you need to calculate the minima cost to make this sequence increasing.
11101110
You are given a sequence f satisfies that fi != fj, you have an operation: swap(fi, fj) and cost you 1 Yuan, you need to calculate the minima cost to make this sequence increasing.
The first line of the input contains a integer T(T <= 10), means the number of test cases.
For each test cases, the first line is a integer N(N <= 100000), which is the length of the sequence(the absolute value of f[i] <= 2000000000, 1<=i<=n). The next line follows n integers, numbered from 1 to n.
For each given sequence, output the minima cost.
1
8
8 23 4 16 77 -5 53 100
5