#P1843. 奶牛晒衣服

奶牛晒衣服

Description

In natural conditions, one second of sun-drying reduces a garment’s humidity by aa units. The stingy Aunt Xiong only bought one dryer. Using the dryer for one second additionally dries bb units of humidity for a single garment (i.e., in one second it can dry a+ba+b humidity), but at the same time only one garment can be machine-dried. There are nn garments, and the humidity of the ii-th garment is wiw_i (guaranteed to be pairwise distinct). Find the minimum time needed to dry all garments (a garment is considered dry when its humidity is 00).

Input Format

The first line contains three integers n,a,bn,a,b.
The next nn lines: on the ii-th of these lines, input wiw_i.

Output Format

Output one line: the minimum time to dry all garments.

3 2 1
1
2
3
1

Hint

Sample Explanation

Dry the third garment with the machine to finish in one second.

Constraints

1wi,a,b,n5×1051 \le w_i,a,b,n \le 5 \times 10^5.

Translated by ChatGPT 5