Welcome to ZOJ
 Problem Sets Information Select Problem Runs Ranklist
ZOJ Problem Set - 2085
Wishingbone's Victory

Time Limit: 2 Seconds      Memory Limit: 65536 KB

Wishingbone and his brother are both bone-collectors. They love to play a game for exchanging their bones. The rule of this game is simple: His brother knows that Wishingbone is quite smart, so he asks several questions. For each question, if Wishingbone can answer it correctly, he will win a bone, and his brother loses one, otherwise he will give a bone to his brother. Originally, each of them has N bones. The game ends when someone has lost all his bones. Wishingbone wants to know how much is the probability of his final victory. He has calculated the probability of winning one bone by dividing his IQ by the sum of theirs. Since you are also very smart, he left the following calculation to you. You must write a program to help Wishingbone solve this problem.

Input

The input consists of several test cases. Each test case contains two numbers:

The first one is a positive integer N (N <= 50), the number of bones each of them has.

The second one is a real number p (0 <= p <= 1), the probability that Wishingbone wins one bone.

Output

For each test case, print in one line the probability of Wishingbone's victory, accurate up to 6 decimal places.

Sample Input

2 0.5

Sample Output

0.500000

Author: JIANG, Ming
Source: ZOJ Monthly, February 2004
Submit    Status