#abc303f. [abc303_f]Damage over Time
[abc303_f]Damage over Time
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.
Sample Input 1
2 20
2 2
5 1
Sample Output 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 .
Sample Input 2
10 200
1 21
1 1
1 1
8 4
30 1
3 1
10 2
8 1
9 1
4 4
Sample Output 2
9