So You Want to Be a 2ⁿ-aire?

Time limit1sMemory limit128 MB

Problem

A contestant starts with a prize of $1 and is asked a sequence of $n$ questions. For each question, the contestant may:

  • quit and keep the current prize;
  • answer the question. If the answer is wrong, the contestant quits with nothing. If it is correct, the prize is doubled and the contestant continues to the next question.

After the last question, the contestant quits with the current prize. The contestant wants to maximize the expected prize.

Once a question is asked, the contestant can assess the probability $p$ of answering it correctly. For each question, assume $p$ is a random variable uniformly distributed over the interval $[t, 1]$.

Input

The input consists of several lines. Each line contains two numbers: an integer $n$ ($1 \le n \le 30$) and a real number $t$ ($0 \le t \le 1$). The input is terminated by a line containing 0 0, which must not be processed.

Output

For each pair $n$ and $t$, print the expected prize the contestant earns when playing the optimal strategy, rounded to three decimal places.