You are given two integers, numBottles and numExchange.
Initially, you have numBottles full water bottles. In one operation, you can perform one of the following actions:
Drink any number of full water bottles, turning each into an empty water bottle.
Exchange numExchange empty water bottles for numExchange by
Return the maximum number of water bottles you can drink.
Note: Each exchange operation consumes
numExchangeempty bottles and immediately incrementsnumExchangeby. You cannot perform multiple exchanges simultaneously with the same numExchangevalue.
Constraints:
numBottles
numExchange
You are given two integers, numBottles and numExchange.
Initially, you have numBottles full water bottles. In one operation, you can perform one of the following actions:
Drink any number of full water bottles, turning each into an empty water bottle.
Exchange numExchange empty water bottles for numExchange by
Return the maximum number of water bottles you can drink.
Note: Each exchange operation consumes
numExchangeempty bottles and immediately incrementsnumExchangeby. You cannot perform multiple exchanges simultaneously with the same numExchangevalue.
Constraints:
numBottles
numExchange