Under construction

Still being built. Things may change

Exam Supervisors

Interview

Time limit2sMemory limit512 MB

Summary
Each room needs one chief who covers B candidates plus enough assistants covering C each, so sum 1 + ceil(max(0, Ai - B) / C) over all rooms.
Level

Easy3 of 10

Topics
Math, Greedy, Implementation
Solved
No attempts yet

Problem

There are NN exam rooms, and each room has candidates in it. Room ii has AiA_i candidates.

Supervisors come in two kinds, chief and assistant. One chief supervisor watches at most BB candidates in a single room, and one assistant supervisor watches at most CC candidates in a single room.

Every room must have exactly one chief supervisor, and it may have any number of assistant supervisors. No supervisor covers more than one room.

Every candidate in every room has to be watched. Write a program that finds the smallest number of supervisors that makes this possible.

Input

The first line has the number of exam rooms NN. (1≤N≤10000001 \le N \le 1000000)

The second line has the candidate counts A1,A2,…,ANA_1, A_2, \dots, A_N, separated by spaces. (1≤Ai≤10000001 \le A_i \le 1000000)

The third line has BB and CC, separated by a space. (1≤B,C≤10000001 \le B, C \le 1000000)

Output

Print the smallest number of supervisors needed to watch every candidate in every room, on one line.

Examples5

  1. Example 1

    Input
    1
    1
    1 1
    
    Expected output
    1
    
  2. Example 2

    Input
    3
    3 4 5
    2 2
    
    Expected output
    7
    
  3. Example 3

    Input
    5
    1000000 1000000 1000000 1000000 1000000
    5 7
    
    Expected output
    714290
    
  4. Example 4

    Input
    5
    10 9 10 9 10
    7 20
    
    Expected output
    10
    
  5. Example 5

    Input
    5
    10 9 10 9 10
    7 2
    
    Expected output
    13