题目描述
Problem Description
Snuke initially has 1 biscuit and no Japanese yen. Snuke can perform the following operations in any order, totaling exactly $ K $ times:
- Hit the biscuits to increase the count by 1
- Exchange $ A $ biscuits for 1 yen
- Exchange 1 yen for $ B $ biscuits
Determine the maximum number of biscuits Snuke can have after $ K $ operations.
Input Format
The input is given from the standard input in the following format:
$ K $ $ A $ $ B $
Output Format
Output the maximum number of biscuits Snuke can have after $ K $ operations.
Sample Input and Output
Sample Input #1
4 2 6
Sample Output #1
7
Sample Input #2
7 3 4
Sample Output #2
8
Sample Input #3
314159265 35897932 384626433
Sample Output #3
48518828981938099
Notes/Hints
Constraints
- $1 \leq K, A, B \leq 10^9$
- $ K, A, B $ are integers
Sample Explanation 1
The following operations maximize the number of biscuits after $ K $ operations:
- Hit the biscuits. Snuke has 2 biscuits and 0 yen.
- Exchange 2 biscuits for 1 yen. Snuke has 0 biscuits and 1 yen.
- Hit the biscuits. Snuke has 1 biscuit and 1 yen.
- Exchange 1 yen for 6 biscuits. Snuke has 7 biscuits and 0 yen.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分