cswork / OA打开练习工作台

AdobeOA #6

Job Execution

估计中等可在线判题

考点(AI 标注)二分查找

In each round, choose one unfinished task to run for x seconds, while every other unfinished task runs for y seconds, where x>y. A task leaves once it reaches its required time. Find the minimum number of rounds.

输入格式

The first line contains n x y, and the second line contains n required times. The original only states x>y with no numeric bounds; this site sets 1≤n≤100000, 0≤time≤10^9, 0≤y<x≤10^9. Tasks with time 0 are finished from the start.

输出格式

Output a single integer answer.

样例 1

输入:

2 3 1
3 4

输出:

2

样例 2

输入:

2 2 1
0 0

输出:

0

样例 3

输入:

2 1 0
4 4

输出:

8

样例说明

The outputs of the three public examples are, in order: 2; 0; 8. Verified by independent enumeration or direct simulation.