The BCD contest has problems arranged in a fixed order. The difficulty of the problem currently at position is . Every difficulty is an integer from to , inclusive.
A participant with skill solves problems according to these rules.
Thus, a participant solves no problems if the first problem is already too difficult, and solves all problems if every difficulty is at most their skill.
For each participant, compare the number of problems solved in the following two situations.
If the two counts differ, call the participant a victim of Lunarity-style difficulty ordering. The order among problems of equal difficulty does not affect either count.
For example, suppose the difficulties are and a participant's skill is . In the current order, the participant solves the first two problems and stops at the problem of difficulty . They do not solve the later problem of difficulty . In the sorted order , they solve three problems. Therefore, the participant with skill is a victim.
There is exactly one participant with each skill . Find the number of victims of Lunarity-style difficulty ordering.
The input is given in the following format.
For each test case, print the number of victims of Lunarity-style difficulty ordering on its own line.
Sorting gives .
The first line contains the number of test cases . Each test case has the following format.
The first line of each test case contains the number of problems and the maximum participant skill , separated by a space.
The second line contains the difficulties in their current order, separated by spaces.
| 2 | 22 |
|
| 3 | 29 |
|
| 4 | 36 | No additional constraints. |
Exactly the participants with skills and are victims, so the answer is .
Test case : The problems are already in nondecreasing order of difficulty. Every participant solves the same number of problems in both situations, so there are no victims.
Test case : Participants with skills from through solve no problems in the original order, but solve both difficulty- problems after sorting. Each participant is counted once, so the answer is . The participant with skill solves every problem in either order.
Test case : The only participant solves the only problem, and sorting changes nothing.