CF1296D.Fight with Monsters

传统题 时间 2000 ms 内存 256 MiB 8 尝试 40 已通过 10 标签

Fight with Monsters

There are nn monsters standing in a row numbered from 11 to nn. The ii-th monster has hih_i health points (hp). You have your attack power equal to aa hp and your opponent has his attack power equal to bb hp.

You and your opponent are fighting these monsters. Firstly, you and your opponent go to the first monster and fight it till his death, then you and your opponent go the second monster and fight it till his death, and so on. A monster is considered dead if its hp is less than or equal to 00.

The fight with a monster happens in turns.

  1. You hit the monster by aa hp. If it is dead after your hit, you gain one point and you both proceed to the next monster.
  2. Your opponent hits the monster by bb hp. If it is dead after his hit, nobody gains a point and you both proceed to the next monster.

You have some secret technique to force your opponent to skip his turn. You can use this technique at most kk times in total (for example, if there are two monsters and k=4k=4, then you can use the technique 22 times on the first monster and 11 time on the second monster, but not 22 times on the first monster and 33 times on the second monster).

Your task is to determine the maximum number of points you can gain if you use the secret technique optimally.

Input

The first line of the input contains four integers n,a,bn, a, b and kk (1n2105,1a,b,k1091 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique.

The second line of the input contains nn integers h1,h2,,hnh_1, h_2, \dots, h_n (1hi1091 \le h_i \le 10^9), where hih_i is the health points of the ii-th monster.

Output

Print one integer — the maximum number of points you can gain if you use the secret technique optimally.

Samples

6 2 3 3
7 10 50 12 1 8
5
1 1 100 99
100
1
7 4 2 1
1 3 5 4 2 7 6
6

在线编程 IDE

建议全屏模式获得最佳体验