The 8600’s mobile phone consumes 1 yuan per day, and every K yuan spent will receive 1 yuan. At the beginning, 8600 has M yuan. How many days can I use?
The input includes multiple test instances. Each test instance includes two integers M, k, (2 <= k <= M <= 1000). M = 0, k = 0 represents the end of the input.
An integer is output for each test instance, which indicates the number of days that M yuan can be used.
1 | 2 2 |
1 | 3 |
This is just stimulation. At first I think the answer was $m + m \div k$ . However, I didn’t think of that there may be given more than k days more.
1 |
|