class Solution {
public int numWaterBottles(int numBottles, int numExchange) {
int bottles = numBottles;
while (numBottles >= numExchange) {
bottles += numBottles / numExchange;
numBottles = numBottles / numExchange + numBottles % numExchange;
}
return bottles;
}
}