Morjani and buildings#12330

Morjani and buildings

1 second
256 megabytes
Medium

you're given buildings numbered 1,2,3,...,n and an integer ,each building has a height h_i, you are standing to the left of the first building , you can see a building if it is taller than all previous buildings ie (h_i < h_j) for all (1 \le i < j)

your friend Morjani is standing on the top of building , you can do the following operation several number of times :

ATTENTION : that's very important iterates through all candidate heights and compute the answer based on that

Find the minimum number of operations to make Morjani visible.

Input

The first line contains a single integer (1 \le t \le 10^4) — the number of test cases.

The first line of each test case contains two integers (1\le k \le n \le 2\cdot10^5) — the count of buildings and the building where Morjani stands respectively.

The second line of each test case contains integers h_1,h_2,...,h_n (1\le h_i \le 10^9) — the height of buildings 1,2,3,..,n in this order respectively.

it's guaranteed that the sum of over all test cases does not exceed 2\cdot10^5 .

Output

For each test case,print a single integer,the answer of the problem.

Examples

Example 1

Loading
Loading

Note

In the first test case , building is already visible so you don't have to do any operation.

In the second test case , you can do the following:

  • choose the second building and decrease it's height by

  • choose the third building and increase it's height by

Scoring

  • Subtask ( points): (k=1).

  • Subtask ( points): No additional constraints.