Alawn has a length
Alawn loves arrays that satisfy the following property:
- The
values can be sorted by only swapping elements and where .
A modification to the array consists of decreasing element
Input Specification
The first line will contain
For each test case, the first line will contain two integers
The second line will contain
Output Specification
For each case, output the minimum number of modifications required on its own line.
Sample Input
Copy
2
5 1
1 2 3 4 5
5 4
1 2 5 3 6
Sample Output
Copy
0
1
Comments