Barrels

Time limit: 0.1s Memory limit: 64MB Input: Output:

A lot of bugs from Bugland have invaded a wine cellar trough a magic portal. The wine cellar consists of NN rooms, each full with barrels of wine, and the ithi^{th} room being infested with ViV_i bugs.

The owners of the wine cellar have at their disposal NN insecticides of two types: KK sprays named AntiBug, which can remove PP bugs a day, and NKN-K sprays named ZeroBugs, which can remove QQ bugs a day. Every day, a spray is used in every room.

Task

Given those details, what is the minimum number of days in which the barrels of wine are saved by eliminating all the bugs?

Input data

The first line will contain two numbers, NN and KK, on the second one PP and QQ, and on the third NN numbers, the ithi^{th} representing the number of bugs ViV_i from the ithi^{th} room.

Output data

The first line will contain the minimum number of days necessary to eliminate all the bugs.

Constraints and clarifications

  • KN2105K \leq N \leq 2\cdot 10^5
  • P,Q109P, Q \leq 10^9
  • Vi109  1iNV_i \leq 10^9\ \forall\ 1 \leq i \leq N
  • For tests worth 40 points: KN104K \leq N \leq 10^4, P,Q100P, Q \leq 100 and Vi104V_i \leq 10^4.
  • A spray can be used in a single room each day, and two sprays cannot be used in the same room because using different types of sprays simultaneously can cause serious damage to the wine, and multiple uses of the same type of spray do not amplify the effect.

Example

stdin

5 2
3 1
3 4 5 7 8

stdout

4

Explanation

After one day: 3 4 5 7 82 3 4 4 53\ 4\ 5\ 7\ 8 \rightarrow 2\ 3\ 4\ 4\ 5 (from rooms 44 and 55, 33 bugs will be eliminated and from rooms 11, 22 and 33, 11 bug)

After two days: 2 3 4 4 51 2 3 1 22\ 3\ 4\ 4\ 5 \rightarrow 1\ 2\ 3\ 1\ 2 (from rooms 44 and 55, 33 bugs will be eliminated and from rooms 11, 22 and 33, 11 bug)

After tree days: 1 2 3 1 20 1 0 0 01\ 2\ 3\ 1\ 2 \rightarrow 0\ 1\ 0\ 0\ 0 (from room 33, 33 bugs will be eliminated, from room 55, 22 bugs and from rooms 11, 22 and 44, 11 bug)

After four days: 0 1 0 0 00 0 0 0 00\ 1\ 0\ 0\ 0 \rightarrow 0\ 0\ 0\ 0\ 0 (from room 22, 11 bug will be eliminated)

Log in or sign up to be able to send submissions!