Question: Solve it ASAP! I will upvote. Thanks, Java/CPP/Python any language you wish. Just make the logic clear. 3. Drink as many bottles as you like!

Solve it ASAP! I will upvote. Thanks,

Java/CPP/Python any language you wish. Just make the logic clear.

Solve it ASAP! I will upvote. Thanks, Java/CPP/Python any language you wish.Just make the logic clear. 3. Drink as many bottles as you

3. Drink as many bottles as you like! The market is selling a new brand of soft drink, which price is 2 dollars. There are several rules can be used to exchange new full bottle of the drink: (1) Every 2 empty bottles of this drink can be exchanged for 1 full bottle. (2) Every 4 caps of this drink can be exchanged for 1 full bottle. So now, there is a boy who has n dollars, please calculate what is the maximum bottle of drink he can buy in total? Example 1: Input: n = 30 Output: 55 Example 2: Input: n = 2 Output: 1 Example 1: Input: n = 30 Output: 55 Example 2: Input: n = 2 Output: 1 Example 2: Input: n = 1 Output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!