#Lutece2694. Mastiff Shotgun
Mastiff Shotgun
Migrated from Lutece 2694 Mastiff Shotgun
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Jeff Lee is falling in love with a game called Apex Legends recently. It is an online multiplayer battle royale game featuring squads of three players using pre-made characters with distinctive abilities.
Jeff Lee picked up a weapon called Mastiff Shotgun at the beginning of a game. Not knowing how it works, he cannot hit even a single enemy. After the game, he trains a lot to use Mastiff Shotgun and figures out how it works.
Now Jeff Lee starts another game and encounters an enemy. Here we describe the enemy as a segment on a one-dimensional axis, ranging from to . The enemy has health points initially. Jeff Lee is now equipped with Mastiff Shotgun. If he aims at and takes a shot, the weapon will shoot bullets which will hit respectively at the same time. Each bullet that hits the enemy deals points of damage. Formally, if the number of bullets that meet is , the enemy's health point will decrease by . The enemy will be knocked down if his health point is lower than or equal to .
Now Jeff Lee wants to know whether he can knock down the enemy after one shot aiming at . If he can, tell him how many bullets hit the enemy. Otherwise, tell him how many more shots he needs at least to knock down the enemy apart from the first shoot if he can change his aiming point after the first shot.
Input
The first line contains one integer (), denoting the number of bullets in one shoot.
The second line contains integers ().
The third line contains five integers. The first two integers () indicate the enemy's position. The third integer () indicates the enemy's initial health point. The fourth integer () indicates the points of damage for each bullet. The fifth integer () indicates the aiming point of the first shot.
Output
If Jeff Lee can knock down the enemy after the first shot, output in the first line. Then output an integer in the second line, indicating the number of bullets that hit the enemy.
If Jeff Lee cannot knock down the enemy after the first shot, output in the first line. Then output an integer in the second line, indicating the minimum number of shots he needs to knock down the enemy apart from the first shoot. Please note that he can change his aiming point after the first shot.
Samples
7
-4 -2 -1 0 1 2 4
-4 4 70 11 0
YES
7
7
-4 -3 -2 0 1 2 4
-1 1 88 11 0
NO
2
Note
For the first example, all the bullets hit the enemy and deal points of damage.
For the second example, the first shoot deals points of damage. Then Jeff Lee can change his aiming point to , and each shoot will deal points of damage. The enemy will be knocked down after two more shots.
Resources
电子科技大学第十二届 ACM 趣味程序设计竞赛