You are given an array A of N distinct integers, your task is to sort the given array using the below operation.
Your task is to print the minimum number of operations to achieve this.
Input format
Output format
Print T lines. For each test case:
Constraints
1≤T≤20000
1≤N≤200000
1≤Ai≤109∀i∈[1,N]
All Ai are distinct.
The sum of N over all test cases does not exceed 200000.
[7,3,1,5,4] in the beginning, for optimal conversion:
There is no way which involves lesser than three steps.