atcoder#ABC303F. [ABC303F] Damage over Time
[ABC303F] Damage over Time
Score : points
Problem Statement
A monster with health has appeared in front of you, and a turn-based battle has started.
In each turn , you cast one of spells, spells .
If you cast spell in turn , the monster's health reduces by in each turn .
Find the earliest turn that you can make the monster's health or less.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
2 20
2 2
5 1
6
The following procedure makes the monster's health or less in turn , which is the earliest.
- Cast spell in turn . Due to the spell cast in turn , the monster's health reduces by and becomes .
- Cast spell in turn . Due to the spells cast in turns and , the monster's health reduces by and becomes .
- Cast spell in turn . Due to the spells cast in turns and , the monster's health reduces by and becomes .
- Cast spell in turn . Due to the spells cast in turns and , the monster's health reduces by and becomes .
- Cast spell in turn . Due to the spells cast in turns and , the monster's health reduces by and becomes .
- Cast spell in turn . Due to the spells cast in turns and , the monster's health reduces by and becomes .
10 200
1 21
1 1
1 1
8 4
30 1
3 1
10 2
8 1
9 1
4 4
9