cho.sh
Notes
Loading...

Finding the Rank

Time limit

2s

Memory limit

128 MB

Problem

Taesu keeps a ranking list for each song in a rhythm game. Each list stores the current scores from highest to lowest.

The rank of a score is one plus the number of scores that are strictly higher than it. Equal scores share the same rank. If the list is 100, 90, 90, 80, the ranks are 1, 2, 2, 4.

You are given the maximum number of scores P that the ranking list can hold, the current N scores, and Taesu's new score. Print the rank of the new score if it can be placed on the list, or print -1 if it cannot.

If the list already contains P scores, the new score can be placed only when it is strictly higher than the current last score.

Input

The first line contains N, Taesu's new score, and P.

P is an integer between 10 and 50 inclusive, and N is an integer between 0 and P inclusive. Every score is an integer between 0 and 2,000,000,000 inclusive.

If N is greater than 0, the second line contains the current N scores in non-increasing order. If N is 0, the second line is not given.

Output

Print the rank of Taesu's new score on the ranking list. If the score cannot be placed on the list, print -1.