题目描述
Problem Description
Long, long ago, there was a king with a long chin in the Kingdom of Paken.
When the king announced a search for a spouse, $ N $ candidates applied.
The king decided to marry the candidate whose chin was shorter than his but the longest among those who were shorter.
The length of the king's chin is $ K $, and the length of the chin of the $ i $-th ($1 \leq i \leq N$) applicant is $ a_i $.
Which person will the king marry?
If there are no candidates with a shorter chin than the king, output $ -1 $.
Assume that there are no people with the same chin length, including the king.
Input Format
The input is given from the standard input in the following format:
$ N $ $ K $
$ a_1 $ $ a_2 $ $\ldots$ $ a_N $
Output Format
Output the number of the person the king chooses as his spouse in one line.
If there is no suitable candidate, output $ -1 $.
Sample Input and Output
Sample Input #1
4 10
11 9 15 13
Sample Output #1
2
Sample Input #2
5 10000
763618767 814402216 467921615 163029185 204341760
Sample Output #2
-1
Notes/Hints
Constraints
- All inputs are integers.
- $1 \leq N \leq 2 \times 10^5$
- $1 \leq K, a_i \leq 10^9$
- $a_i \neq a_j$ ($i \neq j$)
- $a_i \neq K$
Sample Explanation 1
The king's chin length is $ 10 $. The candidate with the longest chin shorter than $ 10 $ is the $ 2 $-nd candidate with a chin length of $ 9 $.
Sample Explanation 2
There are no candidates with a chin length shorter than the king. In such cases, output $ -1 $ to be correct.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分