totalDrunk to numBottles (the initial number of full bottles).emptyBottles to numBottles (since all bottles will be empty after drinking).emptyBottles is greater than or equal to numExchange:
a. Calculate newBottles as the quotient of emptyBottles divided by numExchange.
b. Add newBottles to totalDrunk.
c. Update emptyBottles to newBottles (new full bottles) plus the remainder of emptyBottles divided by numExchange (leftover empty bottles).totalDrunk as the maximum number of bottles that can be drunk.