CitadelOA #7
Minimum Operations to Empty Job Pool
估计中等可在线判题
考点(AI 标注)二分查找
In each round, choose one unfinished task as the primary task and execute it for x seconds, while every other unfinished task executes for y seconds, where y<x. A task leaves as soon as it has executed enough; find the minimum number of rounds to empty the task pool.
输入格式
The first line contains n x y, followed by n execution amounts. Complete original bounds: 1≤n≤100000, 1≤execution amount≤10^9, 1≤y<x≤10^9; problem 17 keeps its original bound of 300,000 and does not reuse the 100,000 of problem 7.
输出格式
Output a single integer, the answer.
样例 1
输入:
5 4 2
3 4 1 7 6
输出:
3
样例 2
输入:
5 3 2
3 3 6 3 9
输出:
3
样例 3
输入:
3 3 1
2 3 5
输出:
3
样例说明
The outputs of the three public examples are, in order: 3; 3; 3. These answers were verified by independent enumeration or direct simulation.