You start with numBottles full water bottles, and you can trade numExchange empty bottles for one full bottle. Drinking a full bottle leaves an empty one. Return the maximum number of bottles you can drink.
You start with numBottles full water bottles, and you can trade numExchange empty bottles for one full bottle. Drinking a full bottle leaves an empty one. Return the maximum number of bottles you can drink.
Example 1:
Input: {"numBottles":9,"numExchange":3}
Output: 13
Constraints:
1≤numBottles≤100
2≤numExchange≤100
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"numBottles":9,"numExchange":3}
You hold 9 full bottles, and 3 empties trade for 1 full bottle.