시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 38 | 9 | 8 | 57.143% |
John and George play the following game: John chooses one integer x in the set An = {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 Bk of An and John says YES, if x belongs to Bk 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 game that calculates the wanted minimum amount.
On the first line of the standard input are given three integers n, a, and b, separated by a space.
On the standard output, print out one integer, that is equal to the wanted minimum amount of euros.
번호 | 배점 | 제한 |
---|---|---|
1 | 26 | 1 < n < 10 000, 0 < a < 1 000, 0 < b < 1 000 |
2 | 38 | 10 000 ≤ n < 10 000 000, 0 < a< 1 000, 0 < b < 1 000 |
3 | 36 | 10 000 000 ≤ n < 1018, a = 1, 0 < b < 1 000 |
5 1 2
4
George can find x for 4 euros, in the following way:
George selects set B1 = {1, 2}.