atcoder#DPI. Coins
Coins
Score : points
Problem Statement
Let be a positive odd number.
There are coins, numbered . For each (), when Coin is tossed, it comes up heads with probability and tails with probability .
Taro has tossed all the coins. Find the probability of having more heads than tails.
Constraints
- is an odd number.
- is a real number and has two decimal places.
Input
Input is given from Standard Input in the following format:
Output
Print the probability of having more heads than tails. The output is considered correct when the absolute error is not greater than .
3
0.30 0.60 0.80
0.612
The probability of each case where we have more heads than tails is as follows:
- The probability of having is ;
- The probability of having is ;
- The probability of having is ;
- The probability of having is .
Thus, the probability of having more heads than tails is .
1
0.50
0.5
Outputs such as 0.500
, 0.500000001
and 0.499999999
are also considered correct.
5
0.42 0.01 0.42 0.99 0.42
0.3821815872