CF1296D.Fight with Monsters
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are n monsters standing in a row numbered from 1 to n . The i -th monster has hi health points (hp). You have your attack power equal to a hp and your opponent has his attack power equal to b 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 0 .
The fight with a monster happens in turns.
- You hit the monster by a hp. If it is dead after your hit, you gain one point and you both proceed to the next monster.
- Your opponent hits the monster by b 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 k times in total (for example, if there are two monsters and k=4 , then you can use the technique 2 times on the first monster and 1 time on the second monster, but not 2 times on the first monster and 3 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.
输入格式
The first line of the input contains four integers n,a,b and k ( 1≤n≤2⋅105,1≤a,b,k≤109 ) — 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 n integers h1,h2,…,hn ( 1≤hi≤109 ), where hi is the health points of the i -th monster.
输出格式
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
输入输出样例
输入#1
6 2 3 3 7 10 50 12 1 8
输出#1
5
输入#2
1 1 100 99 100
输出#2
1
输入#3
7 4 2 1 1 3 5 4 2 7 6
输出#3
6