/
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 200 点
問題文
高橋君は青木君から A 円を借りています。高橋君は毎月給料をもらうたびに、青木君に B 円ずつ返します。ただし、残りの借金が B 円より少ない月は、残り全額を返して完済します。
高橋君が完済するまでに、何回返済をすることになるかを求めてください。
制約
- 1 \leq A \leq 10^9
- 1 \leq B \leq 10^9
- 入力はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
A B
- 1 行目には、借金の額 A と毎月の返済額 B がスペース区切りで与えられる。
出力
完済するまでの返済回数を 1 行で出力せよ。
入力例 1
100000 30000
出力例 1
4
入力例 2
90000 30000
出力例 2
3
入力例 3
5 100
出力例 3
1
入力例 4
472683540 407987973
出力例 4
2
入力例 5
468431945 72317722
出力例 5
7
Score : 200 pts
Problem Statement
Takahashi has borrowed A yen from Aoki. Every time Takahashi receives his monthly salary, he repays B yen to Aoki. However, in a month when the remaining debt is less than B yen, he repays the entire remaining amount and the debt is fully paid off.
Find the number of repayments Takahashi will make until the debt is fully paid off.
Constraints
- 1 \leq A \leq 10^9
- 1 \leq B \leq 10^9
- All input values are integers.
Input
The input is given from standard input in the following format:
A B
- The first line contains the debt amount A and the monthly repayment amount B, separated by a space.
Output
Print the number of repayments until the debt is fully paid off, on a single line.
Sample Input 1
100000 30000
Sample Output 1
4
Sample Input 2
90000 30000
Sample Output 2
3
Sample Input 3
5 100
Sample Output 3
1
Sample Input 4
472683540 407987973
Sample Output 4
2
Sample Input 5
468431945 72317722
Sample Output 5
7