Let
There are
Taro has tossed all the
Constraints
is an odd number. . is a real number and has two decimal places.
Input Specification
The first line will contain the integer
The next line will contain
Output Specification
Print the probability of having more heads than tails. The output is considered correct when the absolute error is not greater than
Sample Input 1
Copy
3
0.30 0.60 0.80
Sample Output 1
Copy
0.612
Explanation For Sample 1
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
Sample Input 2
Copy
1
0.50
Sample Output 2
Copy
0.5
Explanation For Sample 2
Outputs such as 0.500
, 0.500000001
and 0.499999999
are also considered correct.
Sample Input 3
Copy
5
0.42 0.01 0.42 0.99 0.42
Sample Output 3
Copy
0.3821815872
Comments
remember that doubles are automatically rounded to 6 decimal places during output