Free chocolate
Time Limit: 1.0 s
Memory Limit: 512.0 MB
Description
There is a strange shop in Seriousland which sells chocolates at a rate of 1 taka per chocolate.
But the strange thing is anyone can get a chocolate from the shop in exchange of 2 empty chocolate packet.
If you have \(N\) taka, then how many chocolates you can eat in total ?
Input
Only one integer \(N\)
\(1 <= N <= 100\)
Output
one integer : maximum number of chocolate you can eat with \(N\) taka.
Sample
Input | Output |
---|---|
|
|
first of all you can buy 5 chocolate from the shop, after eating all the chocolates you will have 5 empty packet of chocolate.
then you can buy 2 chocolate in exchange of 4 empty chocolate. After eating 2 chocolate you will have 3 empty packets.
then you can buy 1 more chocolate in exchange of 2 empty packet and will have 2 empty packet after eating the current chocolate.
finally you can buy one more chocolate using remaining 2 empty packet and after eating the chocolate you will left with only one empty packet.
so in total you can eat 5 + 2 + 1 + 1 = 9 chocolate
Information
- ID
- 1176
- Difficulty
- 4
- Category
- (None)
- Tags
- (None)
- # Submissions
- 44
- Accepted
- 18
- Accepted Ratio
- 41%
- Uploaded By
Related
In following contests: