#P6949. Swap
Swap
Problem Description
You are given a sequence of length $N$, and there is also a number $H$ in your hands.
In each step, you can swap the number in your hands with one of the numbers in the sequence.
Now you need to find the minimum steps to make the sequence in non-decreasing order.
Input
There are multiple test cases.
For each test case, the first line contains two integers $N$ and $H$, denoting the length of the sequence and the number in your hands initially.
The second line contains $N$ integers $A_1,A_2,\ldots,A_N$, denoting the initial sequence.
$1\leq H,A_i \leq 10^9$. And the sum of $N$ of all test cases is not larger than $300000$.
Output
For each test case, print an integer in one line, denoting your answer.
4 3
1 4 2 5
4 3
1 2 5 4
6 2
2 3 4 2 3 4
6 2
3 4 5 3 4 5
2
1
3
4