QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓

#18670. If you sleep now, you will dream, but...

Statistiques

"There is a saying: 'If you sleep now, you will dream; if you study now, you will realize your dream.'" But Silver's thinking is a little different. Silver believes that sleeping well is important to increase the efficiency of studying. Silver, who had many assignments to do, wants to sleep moderately and complete as many assignments as possible.

Silver has $N$ assignments, and the deadline of the $i$-th assignment is $T_i$. Silver can start at time 0 and choose any assignment at any time to work on. Only one assignment can be worked on at a time, and it is not possible to start another assignment while working on one. It takes $A$ time for Silver to complete one assignment.

Silver chooses an integer $X$ between $0$ and $(A-1)$ inclusive, and then can sleep for $BX$ time. After sleeping, it takes $(A-X)$ time to complete one assignment. Sleeping can be done at most once, and cannot be done while working on an assignment. Also, Silver can sleep starting from time 0.

Silver wants to sleep moderately to maximize the number of assignments completed before their deadlines. Completing the $i$-th assignment exactly at time $T_i$ is also considered to be completed before the deadline.

Let's find the maximum number of assignments that can be completed before their deadlines!

Input

The first line contains the number of assignments $N$, the initial time $A$ to complete one assignment, and the integer $B$ that serves as the basis for reducing assignment completion time. ($1 \le N, A, B \le 100$)

The second line contains the deadlines $T_i$ of each assignment. ($1 \le T_i \le 10\,000$)

All numbers in the input are integers.

Output

Output the maximum number of assignments that can be completed before their deadlines on the first line.

Examples

Input 1

3 40 2
70 90 80

Output 1

3

Input 2

3 40 10
70 90 80

Output 2

2

Input 3

4 30 3
70 75 95 105

Output 3

4

Input 4

8 2 5
2 8 9 10 11 12 13 14

Output 4

8

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.