atcoder#YAHOOPROCON2019QUALC. When I hit my pocket...
When I hit my pocket...
Score : points
Problem Statement
Snuke has one biscuit and zero Japanese yen (the currency) in his pocket. He will perform the following operations exactly times in total, in the order he likes:
- Hit his pocket, which magically increases the number of biscuits by one.
- Exchange biscuits to yen.
- Exchange yen to biscuits.
Find the maximum possible number of biscuits in Snuke's pocket after operations.
Constraints
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible number of biscuits in Snuke's pocket after operations.
4 2 6
7
The number of biscuits in Snuke's pocket after operations is maximized as follows:
- Hit his pocket. Now he has biscuits and yen.
- Exchange biscuits to yen. his pocket. Now he has biscuits and yen.
- Hit his pocket. Now he has biscuits and yen.
- Exchange yen to biscuits. his pocket. Now he has biscuits and yen.
7 3 4
8
314159265 35897932 384626433
48518828981938099