Question
Minimum Value Transformation

In a mystical land, Dev was given two integers, N and K, by a wise sage. Starting with a number A = 1, Dev had to perform exactly N operations to transform A. In each move, he could either double the value of A or add K to it. The challenge was to find the minimum possible value of A after completing exactly N operations. Can you help Dev figure out the smallest value of A at the end of the journey?

Input
The first line of the input contains two space-separated integers N and K.

Constraints:
1 ≤ N ≤ 105
1 ≤ K ≤ 109
Output
Print the minimum possible value of A after exactly N operations.
Example
Sample Input
4 3
Sample Output
10
Explanation
Dev perform the moves like this:
1 -> 2 (double)
2 -> 4 (double)
4 -> 7 (add)
7 -> 10 (add)

Online