Alice lives in a country. In this country, there are only \(N\) cities located in a row, each city has a magic number such as the \(i^{th}\) city contains \(a_i\) number. She wants to visit the \(K\) cities of this country. Alice starts with a city where the magic number of that city is \(1\). Then if you are in city \(X\), then the next city can be city \(Y\), if \(a_y = a_x + 1\). Alice wants to choose the order of the cities she will visit so that the distance traveled was the maximum. The distance between neighboring cities is \(1\).
Input format
- The first line is the number \(T\) denoting the number of tests.
- The first line of each test contains two integers \(N\) and \(K\) denoting the number of cities in the country and the number of cities Alice wants to visit.
- The second line contains \(N\) integers \(a_i\) denoting magic numbers for each city.
Output format
In a single line, print one integer denoting the maximum distance that Alice will have to cover.
Constraints
\(1 ≤ T ≤ 10\)
\(1 ≤ K ≤ N ≤ 10^5\)
\(1≤ a_i ≤ K\)
For each $$j$$, there is at least a city with the magic number \(j (1≤ j ≤ K) \).