Problem A
So you want to be a 2^n-aire?
The player starts with a prize of $1, and is asked a
sequence of
-
quit and keep his prize.
-
answer the question. If wrong, he quits with nothing. If correct, the prize is doubled, and he continues with the next question.
After the last question, he quits with his prize. The player wants to maximize his expected prize.
Once each question is asked, the player is able to assess
the probability
Input
Input is a number of lines, each with two numbers: an
integer
Output
For each input
Sample Input 1 | Sample Output 1 |
---|---|
1 0.3 2 0.6 24 0.25 0 0 |
1.357 2.560 230.138 |