#A0583. 争先红葫芦
争先红葫芦
Title Description
33DAI has been playing "Black Myth: Wukong" recently. He got a prop called 'Striving for the Red Gourd'.
The game character "Wukong" controlled by 33DAI has an attribute of health value, with a maximum health value of . The initial health value of "Wukong" is . When the health value is less than or equal to , "Wukong" is defeated.
Wukong can use Qianxian Honghuluto restore the health of game characters, up to a maximum of times.
-For the first time, you can change your Qi and Blood value to . -Afterwards, you can increase your HP value by each time (i.e. rounding below ). If the increase is greater than , it will only become .
33DAI is manipulating the battle between "Wukong" and "Guangzhi". "Guangzhi" has launched a total of m attacks, and the i-th attack will reduce Wukong's HP by . After each attack, 'Wukong' can use the 'Striving Red Gourd' several times (or not).
May I ask if 33DAI will be defeated by using the first to compete with the Red Gourd. If you will be defeated, please output the number of times you were defeated in the attack. If you will not be defeated, please output .
Input format
The first line consists of three numbers: , , and .
The second line is number .
Output format
If you will be defeated, please output the number of times you were defeated in the attack. If you will not be defeated, please output .
Example
100 4 5
50 45 60 60 70
-1
100 100 1
101
1
100 0 5
1 1 98 1 1
3
Example explanation
Example 1:
One solution to using gourds is:
- The initial HP value is
- After the first attack, the HP value is
- After the second attack, the HP value is . At this time, using the gourd once will restore the HP value to $
- After the third attack, the HP value is . At this time, using the gourd for times will restore HP each time, and the HP value will be restored to $100.
- After the fourth attack, the HP value is . At this time, using the gourd once will restore HP, and the HP value will be restored to .
- After the fifth attack, the HP value is
Example 2:
After one attack, Wukong was defeated.
Data scale and agreement
For data of , , , .
- Subtask 1 (30 points): Ensure that "Wukong" will not be defeated.
- Subtask 2 (30 points): Ensure that .
- Subtask 3 (40 points): No special restrictions.