So you want to be a 2^n-aire?
The player starts with a prize of and is asked a sequence of questions. For each question, he may
quit a game 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 can assess the probability that he will be able to answer it. For each question, we assume that is a random variable uniformly distributed over the range .
Input
Each line is a separate test case with two numbers: an integer and a real . Input is terminated by a line containing two zeroes. This line should not be processed.
Output
For each test case print the player's expected prize if he plays the best strategy. Output should be rounded to three fractional digits.