Game
John and George play the following game: John chooses one integer x in the set A[n]
= {1, 2, 3, ..., n} . George has to guess the value of x. Players play by consecutive moves = 1, 2, ... . In the k-th move of the game, George chooses a subset B[k]
of A[n]
and John says YES, if x belongs to B[k]
or NO, otherwise. In case of answer NO, George pays John a euros; in case of answer YES, George pays John b euros. We want to know the minimum amount of euros that George has to pay in order to find x, regardless of John's choice.
Write a program that calculates the wanted minimum amount.
Input
In one line given three integers n (1 < n < 10^18
), a and b (0 < a, b < 1000).
Output
Print out one integer, that is equal to the wanted minimum amount of euros.
Examples
Note
George can find x for 4 euros, in the following way:
George selects set B[1]
= {1, 2}.
If John's answer is YES, George pays 2 euros and then selects set
B[2]
= {1}. If the next answer is YES, George pays another 2 euros and the game ends (the chosen integer was 1), otherwise he pays another 1 euro and the game ends (the chosen integer was 2).If John’s answer is NO, George pays 1 euro and selects the set
B[2]
= {3}. If the next answer is YES, George pays another 2 euros and the game ends (the chosen integer was 3), otherwise he pays another 1 euro and selects the setB[3]
= {4}. If the last answer is YES, George pays another 2 euros and the game ends (the chosen integer was 4), otherwise George pays another 1 euro and the game ends (the chosen integer was 5).