#P8627. Drink Exchange Promotion
Drink Exchange Promotion
Drink Exchange Promotion
Ly Yang's Beverage Factory is holding a promotional event. In this event, you can exchange 3 bottle caps for 1 additional C-type beverage, and the process can continue as long as you have enough bottle caps. Given an initial number \(n\) of purchased beverages, determine the total number of beverages that can be consumed if no bottle cap is wasted.
The exchange mechanism works as follows: For every 3 bottle caps, you receive 1 extra drink. Mathematically, if you have \(caps\) bottle caps, you can exchange them for \(\left\lfloor \frac{caps}{3} \right\rfloor\) extra drinks.
inputFormat
An integer \(n\) representing the initial number of C-type beverages purchased.
outputFormat
An integer representing the total number of beverages that can be consumed, including those obtained via exchanges.
sample
1
1