488. Water Bottles
EasySimulation
You have b full bottles; x empty bottles can be exchanged for one full bottle. Print the maximum number of bottles you can drink.
Input format
One line: b x
Output format
The total drunk.
Example 1
Input
9 3
Output
13
Example 2
Input
15 4
Output
19
Constraints
1 ≤ b ≤ 100 2 ≤ x ≤ 100
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…