CodeEff/ECCO huggingface dataset:
# Original solution
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(eval(input())) #整数読み込み
def ifn(): return float(eval(input())) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return list(map(int, input().split())) #整数map取得
def fmn(): return list(map(float, input().split())) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
MOD = 10**9+7

N = iin()
p = fln()

dp = [[0 for _ in range(N+1)] for _ in range(N+1)]

dp[0][0] = 1
for i in range(N):
    for j in range(N):
        dp[i+1][j+1] += dp[i][j]*p[i]
        dp[i+1][j] += dp[i][j]*(1-p[i])
ans = 0.0
for i in range(N//2+1, N+1):
    ans += dp[N][i]
print(ans)


# Optimized solution
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(eval(input())) #整数読み込み
def ifn(): return float(eval(input())) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return list(map(int, input().split())) #整数map取得
def fmn(): return list(map(float, input().split())) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def add_mod(a,b): return (a+b) % MOD

N = iin()
p = fln()

dp = [[0 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0] = 1

for i in range(N):
    for j in range(i+1):
        dp[i+1][j] += dp[i][j] * (1-p[i])
        dp[i+1][j+1] += dp[i][j] * p[i]
ans = 0.0
for i in range(N//2+1, N+1):
    ans += dp[N][i]
print(ans)
# Original solution
#!/usr/bin/env python3

# from pprint import pprint

def recur(parr, curp, curi, heads):
    # if dp[curi][heads] != -1:
    # return dp[curi][heads]
    if curi >= len(parr):
        if heads >= len(parr)//2 + 1:
            return curp
        else:
            return 0

    return (recur(parr, curp*parr[curi], curi+1, heads+1)
            + recur(parr, curp*(1-parr[curi]), curi+1, heads))

n = int(eval(input()))

parr = [float(i) for i in input().split(' ')]

# print(recur(parr, 1, 0, 0))

dp = [[0]*(n+1) for i in range(n+1)]
dp[0][0] = 1

for i in range(1, n+1):
    for j in range(i, -1, -1):
        # heads
        heads = dp[i-1][j-1] if j > 0 else 0
        # tails
        tails = dp[i-1][j]
        dp[i][j] = heads*parr[i-1] + tails*(1-parr[i-1])

print((sum(dp[n][n//2+1:])))


# Optimized solution
#!/usr/bin/env python3

# from pprint import pprint

def recur(parr, curp, curi, heads):
    # if dp[curi][heads] != -1:
    # return dp[curi][heads]
    if curi >= len(parr):
        if heads >= len(parr)//2 + 1:
            return curp
        else:
            return 0

    return (recur(parr, curp*parr[curi], curi+1, heads+1)
            + recur(parr, curp*(1-parr[curi]), curi+1, heads))

n = int(eval(input()))

parr = [float(i) for i in input().split(' ')]

# print(recur(parr, 1, 0, 0))

dp = [0]*(n+1)
dp[0] = 1

for i in range(n):
    for j in range(i+1, -1, -1):
        # heads
        heads = dp[j-1] if j > 0 else 0
        # tails
        tails = dp[j]
        dp[j] = heads*parr[i-1] + tails*(1-parr[i-1])

print((sum(dp[n//2+1:])))
# Original solution
N = int(eval(input()))
P = list(map(float, input().split()))


def solve():
    dp = [[0]*(N+1) for _ in range(N+1)]
    dp[0][0] = 1
    for i in range(1,N+1):
        dp[i][0] = dp[i-1][0]*(1-P[i-1])
    for i in range(1,N+1):
        for j in range(1,i+1):
            dp[i][j] = dp[i-1][j-1]*P[i-1]+dp[i-1][j]*(1-P[i-1])
    ans = sum(dp[-1][(N+2)//2:])
    return ans
print((solve()))

# Optimized solution
N = int(eval(input()))
P = list(map(float, input().split()))


def solve():
    dp = [[0]*(i+2) for i in range(N+1)]
    dp[0][0] = 1
    for i in range(1,N+1):
        dp[i][0] = dp[i-1][0]*(1-P[i-1])
    for i in range(1,N+1):
        for j in range(1,i+1):
            dp[i][j] = dp[i-1][j-1]*P[i-1]+dp[i-1][j]*(1-P[i-1])
    ans = sum(dp[-1][(N+2)//2:])
    return ans
print((solve()))
# Original solution
N=int(eval(input()))
*p,=list(map(float,input().split()))
dp=[[0 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0]=1

for i in range(1,N+1):
    for j in range(N+1):
        if j:
            dp[i][j]=dp[i-1][j]*(1-p[i-1])+dp[i-1][j-1]*p[i-1]
        else:
            dp[i][j]=dp[i-1][j]*(1-p[i-1])

t=N//2+1 if N%2 else N//2
ans=0
for i in range(t,N+1):
    ans+=dp[N][i]

print(ans)

# Optimized solution
N=int(eval(input()))
*p,=list(map(float,input().split()))
dp=[[0]*(N+1) for _ in range(N+1)]
dp[0][0]=1

for i in range(1,N+1):
    for j in range(N+1):
        dp[i][j]=dp[i-1][j]*(1-p[i-1])
        if j:dp[i][j]+=dp[i-1][j-1]*p[i-1]

print((sum(dp[N][i] for i in range(N+1) if 2*i>=N)))
# Original solution
N = int(eval(input()))
p = list(map(float,input().split()))

dp = [[0]*(N+1) for i in range(N)]

dp[0][0] = 1-p[0]
dp[0][1] = p[0]

for i in range(1,N):
    dp[i][0] = (1-p[i])*dp[i-1][0]
    for j in range(1,i+2):
        dp[i][j] = dp[i-1][j-1]*p[i] + dp[i-1][j]*(1-p[i])
        
print((sum(dp[-1][(N+1)//2:])))

# Optimized solution
N = int(eval(input()))
p = list(map(float,input().split()))

dp = [[0.0]*(N+1) for i in range(N+1)]
dp[0][0] = 1.0

for i in range(1,N+1):
    for j in range(0,N+1):
        dp[i][j] = dp[i-1][j-1]*(p[i-1]) + dp[i-1][j]*(1-p[i-1])

res = 0.0
for i in range((N+1)//2,N+1):
    res += dp[-1][i]
print(res)
# Original solution
import sys,queue,math,copy,itertools,bisect,collections,heapq
LI = lambda : [float(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
N = NI()
p = [0.0] + LI()
dp = [[0 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0] = 1
for i in range(1,N+1):
    for j in range(0,i+1):
        if j > 0: dp[i][j] = dp[i-1][j-1] * p[i]
        dp[i][j] += dp[i-1][j] * (1-p[i])

print((sum(dp[-1][N//2+1:])))


# Optimized solution
import sys,queue,math,copy,itertools,bisect,collections,heapq
LI = lambda : [float(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
N = NI()
p = [0.0] + LI()
dp = [[0] * (N+1) for _ in range(N+1)]
dp[0][0] = 1
for i in range(1,N+1):
    for j in range(0,i+1):
        if j > 0: dp[i][j] = dp[i-1][j-1] * p[i]
        dp[i][j] += dp[i-1][j] * (1-p[i])

print((sum(dp[-1][N//2+1:])))
# Original solution
import sys,queue,math,copy,itertools,bisect,collections,heapq
LI = lambda : [float(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
N = NI()
p = [0.0] + LI()
dp = [[0] * (N+1) for _ in range(N+1)]
dp[0][0] = 1
for i in range(1,N+1):
    for j in range(0,i+1):
        if j > 0: dp[i][j] = dp[i-1][j-1] * p[i]
        dp[i][j] += dp[i-1][j] * (1-p[i])

print((sum(dp[-1][N//2+1:])))


# Optimized solution
import sys,queue,math,copy,itertools,bisect,collections,heapq
LI = lambda : [float(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
N = NI()
p = LI()
dp = [[0] * (N+1) for _ in range(N+1)]
dp[0][0] = 1
for i in range(1,N+1):
    for j in range(0,i+1):
        if j > 0: dp[i][j] = dp[i-1][j-1] * p[i-1]
        dp[i][j] += dp[i-1][j] * (1-p[i-1])

print((sum(dp[-1][N//2+1:])))
# Original solution
n=int(eval(input()))
p=[]
for i in input().split():
  p+=[int(i.split(".")[1])]
dp=[[0]*(n+1) for _ in range(n+1)]
dp[0][0]=1
for i in range(n):
  dp[i+1][0]=dp[i][0]*(100-p[i])
  for j in range(i+1):
    dp[i+1][j+1]=dp[i][j]*p[i]+dp[i][j+1]*(100-p[i])
print((sum([dp[n][i] for i in range((n+1)//2,n+1)])/pow(100,n)))

# Optimized solution
n=int(eval(input()))
p=list(map(float,input().split()))
dp=[[0]*(n+1) for _ in range(n+1)]
dp[0][0]=1
for i in range(n):
  dp[i+1][0]=dp[i][0]*(1-p[i])
  for j in range(i+1):
    dp[i+1][j+1]=dp[i][j]*p[i]+dp[i][j+1]*(1-p[i])
print((sum([dp[n][i] for i in range((n+1)//2,n+1)])))
# Original solution
# coding:utf-8

import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return eval(input())


n = II()
P = LF()

# dp[i]: i枚のコインが表になる確率
dp = [1]

# 調和級数
# O(NlogN)
for i in range(n):
    tmp = [0] * (i + 2)
    p = P[i]
    q = 1 - P[i]
    for j in range(i + 1):
        tmp[j] += dp[j] * q
        tmp[j + 1] += dp[j] * p
    dp = tmp

print((sum(dp[n // 2 + 1:])))


# Optimized solution
# coding:utf-8

import sys

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return eval(input())


def main():
    n = II()
    P = LF()

    # dp[i]: i枚のコインが表になる確率
    dp = [1]

    # 調和級数
    # O(NlogN)
    for i in range(n):
        tmp = [0] * (i + 2)
        p = P[i]
        q = 1 - P[i]
        for j in range(i + 1):
            tmp[j] += dp[j] * q
            tmp[j + 1] += dp[j] * p
        dp = tmp

    return sum(dp[n // 2 + 1:])


print((main()))
# Original solution
#import
#import math
#import numpy as np
N = int(eval(input()))
#= input()
#= map(int, input().split())
p = list(map(float, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

dp = [[0.0] * (N + 1) for _ in range(N + 1)]

dp[0][0] = 1

for i, p in enumerate(p, 1):
    pp = 1 - p
    for j in range(i + 1):
        if j == 0:
            dp[i][j] = dp[i - 1][j] * pp
        elif j == i:
            dp[i][j] = dp[i - 1][j - 1] * p
        else:
            dp[i][j] = dp[i - 1][j - 1] * p + dp[i - 1][j] * pp

res = 0.0
n = N // 2 + 1

for cnt in dp[-1][n:]:
    res += cnt

print(res)

# Optimized solution
import sys
input = sys.stdin.readline
#import math
#import numpy as np
N = int(eval(input()))
#= input()
#= map(int, input().split())
p = list(map(float, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

dp = [[0.0] * (N + 1) for _ in range(N + 1)]

dp[0][0] = 1

for i, p in enumerate(p, 1):
    pp = 1 - p
    dpi = dp[i - 1]
    for j in range(i + 1):     
        if j == 0:
            dp[i][j] = dpi[j] * pp
        elif j == i:
            dp[i][j] = dpi[j - 1] * p
        else:
            dp[i][j] = dpi[j - 1] * p + dpi[j] * pp


res = 0.0
n = N // 2 + 1

for cnt in dp[-1][n:]:
    res += cnt

print(res)
# Original solution
import sys
input=sys.stdin.readline
n=int(eval(input()))
P=tuple(map(float,input().split()))
DP=[[0]*(n+1) for _ in range(n+1)]
DP[0][0]=1
for i in range(1,n+1):
    DP[i][0]=DP[i-1][0]*(1-P[i-1])
for i in range(1,n+1):
    for j in range(1,i+1):
        DP[i][j]=DP[i-1][j-1]*P[i-1]+DP[i-1][j]*(1-P[i-1])
ans=0
for i in range(n//2+1,n+1):
    ans+=DP[-1][i]
print(ans)

# Optimized solution
import sys
input=sys.stdin.readline
n=int(eval(input()))
P=tuple(map(float,input().split()))
DP=[[0]*(n+1) for _ in range(n+1)]
DP[0][0]=1
for i in range(1,n+1):
    for j in range(i+1):
        DP[i][j]=DP[i-1][j]*(1-P[i-1])
        if j:
            DP[i][j]+=DP[i-1][j-1]*P[i-1]
ans=0
for i in range(n//2+1,n+1):
    ans+=DP[-1][i]
print(ans)
# Original solution
import sys
input=sys.stdin.readline
n=int(eval(input()))
P=tuple(map(float,input().split()))
DP=[[0]*(n+1) for _ in range(n+1)]
DP[0][0]=1
for i in range(1,n+1):
    for j in range(i+1):
        DP[i][j]=DP[i-1][j]*(1-P[i-1])
        if j:
            DP[i][j]+=DP[i-1][j-1]*P[i-1]
ans=0
for i in range(n//2+1,n+1):
    ans+=DP[-1][i]
print(ans)

# Optimized solution
import sys
input=sys.stdin.readline
n=int(eval(input()))
P=tuple(map(float,input().split()))
DP=[[0.0]*(n+1) for _ in range(n+1)]
DP[0][0]=1.0
for i in range(1,n+1):
    for j in range(i+1):
        DP[i][j]=DP[i-1][j]*(1-P[i-1])
        if j:
            DP[i][j]+=DP[i-1][j-1]*P[i-1]
ans=0.0
for i in range(n//2+1,n+1):
    ans+=DP[-1][i]
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(float, input().split()))
dp = [[0]*(n+1) for _ in range(n+1)]
dp[0][0] = 1
for i in range(1, n+1):
    for j in range(n+1):
        dp[i][j] += dp[i-1][j-1]*p[i-1]
        dp[i][j] += dp[i-1][j]*(1-p[i-1])
print((sum(dp[-1][-(-n//2):])))


# Optimized solution
n = int(eval(input()))
p = list(map(float, input().split()))
dp = [[0]*(n+1) for _ in range(n+1)]
dp[0][0] = 1
for i in range(1, n+1):
    for j in range(n+1):
        dp[i][j] = dp[i-1][j-1]*p[i-1]+dp[i-1][j]*(1-p[i-1])
print((sum(dp[-1][-(-n//2):])))
# Original solution
N = int(eval(input()))
P = list(map(float, input().split()))

dp = [[0] * 3010 for _ in range(3010)]
dp[0][1] = 1
dp[0][0] = 1
# dp[i][j] iまでのコインを使って、j枚の表が出る確率
for i in range(N):
    for j in range(i+1):
        dp[i+1][j+1] += dp[i][j] * P[i]
        dp[i+1][j] += dp[i][j] * (1-P[i])

print((sum(dp[N][N//2+1:])))



# Optimized solution
N = int(eval(input()))
P = list(map(float, input().split()))
dp = [[0] * 3010 for _ in range(3010)]
dp[0][0] = 1
# dp[i][j] iまでのコインを使って、j枚の表が出る確率
for i in range(N):
    for j in range(i+1):
        dp[i+1][j+1] += dp[i][j] * P[i]
        dp[i+1][j] += dp[i][j] * (1-P[i])

print((sum(dp[N][N//2+1:])))
# Original solution
N = int(eval(input()))
p = list(map(float, input().split()))

dp = [[0]*(N+1) for i in range(N)]
# iまで見たときに表の枚数がj枚の確率

dp[0][0] = 1 - p[0]
dp[0][1] = p[0]
for i in range(1, N):
    for j in range(N+1):
        dp[i][j] = dp[i-1][j]*(1-p[i])
        if j > 0:
            dp[i][j] += dp[i-1][j-1]*p[i]

ans = sum(dp[-1][N//2 + 1:])

print(ans)


# Optimized solution
def main():
    N = int(eval(input()))
    p = tuple(map(float, input().split()))

    dp = [0 for i in range(N+1)]
    # iまで見たときに表の枚数がj枚の確率

    dp[0] = 1 - p[0]
    dp[1] = p[0]
    for i in range(1, N):
        for j in range(i+1, -1, -1):

            dp[j] = dp[j]*(1-p[i]) + dp[j-1]*p[i]
            # else:
            #     dp[j] = dp[j]*(1-p[i])

    ans = sum(dp[N//2 + 1:])
    print(ans)


main()
# Original solution
import sys
input=sys.stdin.readline

N=int(eval(input()))
p=list(map(float,input().split()))

dp=[[0]*(N+1)for _ in range(N+1)]
for i in range(N+1):
    for j in range(N+1):
        if i==0 and j==0:
            dp[i][j]=1
        elif i==0:
            continue
        elif j==0:
            dp[i][j]=dp[i-1][j]*(1-p[i-1])
        else:
            dp[i][j]=(dp[i-1][j]*(1-p[i-1]))+(dp[i-1][j-1]*p[i-1])

ans=0
for j in range(((N//2)+1),N+1):
    ans+=dp[N][j]
print(ans)


# Optimized solution
import sys
input=sys.stdin.readline

N=int(eval(input()))
p=list(map(float,input().split()))

dp=[[0]*(N+1)for _ in range(N+1)]
for i in range(N+1):
    for j in range(N+1):
        if i==0 and j==0:
            dp[i][j]=1
        elif j==0:
            dp[i][j]=dp[i-1][j]*(1-p[i-1])
        elif i>=j:
            dp[i][j]=(dp[i-1][j]*(1-p[i-1]))+(dp[i-1][j-1]*p[i-1])

ans=0
for j in range(((N//2)+1),N+1):
    ans+=dp[N][j]
print(ans)
# Original solution
import sys
def main():
    N=int(sys.stdin.readline())
    p=[float(x) for x in sys.stdin.readline().split()]
    dp=[[0 for _ in range(N+1)] for _ in range(N+1)]
    dp[0][0]=1.0
    for i in range(1,N+1):
        dp[i][0]=dp[i-1][0]*(1-p[i-1])
        for j in range(1,i+1):dp[i][j]=dp[i-1][j-1]*p[i-1]+dp[i-1][j]*(1-p[i-1])
    print((sum(dp[N][N//2+1:])))
if __name__=='__main__':main()


# Optimized solution
import sys
def main():
    N=int(sys.stdin.readline())
    p=[float(x) for x in sys.stdin.readline().split()]
    dp=[0 for _ in range(N+1)]
    dp[0]=1.0
    for i in range(1,N+1):
        for j in range(i,0,-1):dp[j]=dp[j-1]*p[i-1]+dp[j]*(1-p[i-1])
        dp[0]=dp[0]*(1-p[i-1])
    print((sum(dp[N//2+1:])))
if __name__=='__main__':main()
# Original solution
n=int(eval(input()))
p=list(map(float,input().split()))

mid=(n+2)//2
dp=[[0]*(n+1) for i in range(n)]
dp[0][0]=1-p[0]
dp[0][1]=p[0]

for i in range(n-1):
    for j in range(n+1):
        if dp[i][j]!=0:
            #表が出るとき
            dp[i+1][j+1]+=dp[i][j]*p[i+1]
            #裏
            dp[i+1][j]+=dp[i][j]*(1-p[i+1])
print((sum(dp[-1][mid:])))

# Optimized solution
n=int(eval(input()))
p=list(map(float,input().split()))

dp=[[0]*(n+1) for i in range(n)]

for i in range(n):
    for j in range(n+1):

        if i==0:
            dp[0][0]=1-p[i]
            dp[0][1]=p[i]
        else:
            #表が出る
            if dp[i-1][j-1]!=0:
                dp[i][j]+=dp[i-1][j-1]*p[i]
            #裏
                dp[i][j-1]+=dp[i-1][j-1]*(1-p[i])

print((sum(dp[-1][int(n/2)+1:])))
#print(dp)
# Original solution
n = int(eval(input()))
probs = [float(c) for c in input().split()]

dp = [[0] * (n+1) for _ in range(n+1)]
dp[0][0] = 1
for coin in range(1, n+1):
    for heads in range(n+1):
        dp[coin][heads] = dp[coin-1][heads] * (1 - probs[coin-1])
        if heads > 0:
            dp[coin][heads] += dp[coin-1][heads-1] * probs[coin-1]

ans = 0
for i in range(n//2 + 1, n+1):
    ans += dp[n][i]

print(ans)

# Optimized solution
n = int(eval(input()))
probs = [float(c) for c in input().split()]

dp = [0] * (n+1)
dp[0] = 1
for coin in range(n):
    for heads in reversed(list(range(n+1))):
        dp[heads] = dp[heads] * (1 - probs[coin-1])
        if heads > 0:
            dp[heads] += dp[heads-1] * probs[coin-1]

ans = 0
for heads in range(n+1):
    tails = n - heads
    if heads > tails:
        ans += dp[heads]

print(ans)
# Original solution
import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: list(map(int, sys.stdin.readline().split()))
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    naf = lambda: list(map(float, sys.stdin.readline().split()))

    n = ni()
    p = naf()

    dp = [[0 for _ in range(n + 1)] for __ in range(n + 1)]
    dp[0][0] = 1

    # dp[i][j] : pのうちi個めまでを投げて、表がj個出る確率
    for i in range(n):
        for j in range(n):
            dp[i + 1][j + 1] += dp[i][j] * p[i]
            dp[i + 1][j] += dp[i][j] * (1 - p[i])

    print((sum(dp[n][(n + 1) // 2:])))


if __name__ == '__main__':
    main()


# Optimized solution
import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: list(map(int, sys.stdin.readline().split()))
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    naf = lambda: list(map(float, sys.stdin.readline().split()))

    n = ni()
    p = naf()

    dp = [[0 for _ in range(n + 1)] for __ in range(n + 1)]
    dp[0][0] = 1

    # dp[i][j] : pのうちi個めまでを投げて、表がj個出る確率
    for i in range(n):
        for j in range(i+1):
            dp[i + 1][j + 1] += dp[i][j] * p[i]
            dp[i + 1][j] += dp[i][j] * (1 - p[i])

    print((sum(dp[n][(n + 1) // 2:])))


if __name__ == '__main__':
    main()
# Original solution
# @author 

import sys

class ICoins:
    def solve(self):
        n = int(eval(input()))
        p = [float(_) for _ in input().split()]
        dp = [[0.0] * (n + 1) for _ in range(n + 1)]
        # dp[i][j] probability of having i heads after j tosses
        dp[0][0] = 1
        for j in range(1, n + 1):
            for i in range(j + 1):
                dp[i][j] = dp[i][j - 1] * (1 - p[j - 1])
                if i > 0:
                    dp[i][j] += dp[i - 1][j - 1] * p[j - 1]

        ans = 0
        for i in range(n + 1):
            if i > n - i:
                ans += dp[i][n]
        print(ans)


solver = ICoins()
input = sys.stdin.readline

solver.solve()


# Optimized solution
# @author 

import sys

class ICoins:
    def solve(self):
        n = int(eval(input()))
        p = [float(_) for _ in input().split()]
        dp = [0.0] * (n + 1)
        # dp[i][j] probability of having i heads after j tosses
        dp[0] = 1
        for j in range(1, n + 1):
            for i in range(j, 0, -1):
                dp[i] = dp[i] * (1 - p[j - 1]) + dp[i - 1] * p[j - 1]
            dp[0] = dp[0] * (1 - p[j - 1])
        ans = 0
        for i in range(n + 1):
            if i > n - i:
                ans += dp[i]
        print(ans)


solver = ICoins()
input = sys.stdin.readline

solver.solve()
# Original solution
from pprint import pprint
n=int(eval(input()))
p=list(map(float,input().split()))
dp=[[0]*(n+1) for _ in range(n+1)]
dp[1][0]=1-p[0]
dp[1][1]=p[0]
for i in range(1,n):
    dp[i+1][0]=dp[i][0]*(1-p[i])
    for j in range(n):
        dp[i+1][j+1]=dp[i][j+1]*(1-p[i])+dp[i][j]*p[i]
print((sum(dp[n][(n//2+1):])))
# pprint(dp)

# Optimized solution
n=int(eval(input()))
p=list(map(float,input().split()))
dp=[[0]*(n+1) for _ in range(n+1)]
dp[1][0]=1-p[0]
dp[1][1]=p[0]
for i in range(2,n+1):
    for j in range(n+1):
        dp[i][j]=dp[i-1][j]*(1-p[i-1])+dp[i-1][j-1]*p[i-1]
print((sum(dp[n][(n//2+1):])))
# Original solution
import sys
# input処理を高速化する
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    lst_p = list(map(float, input().split()))
    # dp[i][j] := 最初の i 枚のコインを投げたときに、表が j 枚となる確率
    # 次のコインが表: dp[i+1][j+1] += dp[i][j]∗p[i]
    # 次のコインが裏: dp[i+1][j] += dp[i][j]∗(1.0−p[i])
    dp = [[0] * (N+1) for i in range(N+1)]
    # 初期条件
    dp[0][0] = 1.0
    for i in range(N):
        for j in range(N):
            dp[i+1][j+1] += dp[i][j] * lst_p[i]
            dp[i+1][j] += dp[i][j] * (1.0 - lst_p[i])
    
    ans = 0
    for i in range((N+1)//2, N+1):
        ans += dp[N][i]
    print(ans)
main()

# Optimized solution
n = int(eval(input()))
p = list(map(float, input().split()))

dp = [[0]*(n+1) for _ in range(n+1)]
dp[0][0] = 1
# dp[i][j]:i番目以前の商品を見たときに表の枚数がj枚となる確率の和

for i in range(1,n+1):
    for j in range(i+1):
            dp[i][j] = dp[i-1][j]*(1-p[i-1])
            if j>0:
                dp[i][j] += dp[i-1][j-1]*p[i-1]

ans = sum(dp[n][(n+1)//2:])

print(ans)