A group of contestants sits at the round table and plays the following game to relieve anxiety before the start of NEERC 2007. The game is played with a single token that is given to one person at the beginning of the game. This person passes the token to the adjacent person on the left-hand side or to the adjacent person on the right-hand side with a certain probability. A person who receives the token does the same with his own probability and so on. The game ends when each person has received the token at least once. The last person who has received the token wins.
The problem is to find the probability of winning for the given person. The probability of passing the token to the left or to the right is individual for each person and is known in advance before the beginning of the game.
Contestants are numbered from 1 to n
Picture shows 7 contestants at the table with the token given to the person number 3.
The first line of the input file contains two integer numbers n
The second line of the input file contains n - 1
Write to the output file a single number that denotes the probability of winning for the person number n
Input
Output
Note: all probabilities in the third example are on the same line in the actual input file.
Sample Input
7 3
0.5 0.5 0.5 0.5 0.5 0.5
3 1
0.3 0.6
24 12
0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.99 0.5
0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01
Sample Output
0.1666666667
0.3000000000
0.9800000000