import sys

sys.setrecursionlimit(10 ** 6)



import functools

import operator

n = int(eval(input()))

p = list(map(float, input().split()))

half = n // 2 + 1



dp = [[None] * (n + 1) for _ in range(n + 1)]

# def dfs(n, depth=n - 1):

#     if depth < 0:

#         return 0

#

#     if dp[n][depth] is not None:

#         return dp[n][depth]

#

#     if n == 0:

#         r = functools.reduce(operator.mul, map(lambda x: 1 - x, p[:depth + 1]))

#     elif (n - 1) == depth:

#         r = functools.reduce(operator.mul, p[:depth + 1])

#     else:

#         r = dfs(n - 1, depth - 1) * p[depth] + dfs(n, depth - 1) * (1 - p[depth])

#     dp[n][depth] = r

#     return r

#

# print(sum(dfs(i) for i in range(half, n + 1)))



for i in range(0, n + 1):

    for depth in range(-1, n):

        if depth == -1:

            dp[i][depth] = 0

        elif i == 0:

            dp[i][depth] = functools.reduce(operator.mul, [1 - x for x in p[:depth + 1]])

        elif (i - 1) == depth:

            dp[i][depth] = functools.reduce(operator.mul, p[:depth + 1])

        else:

            dp[i][depth] = dp[i - 1][depth - 1] * p[depth] + dp[i][depth - 1] * (1 - p[depth])



print((sum(dp[i][n - 1] for i in range(half, n + 1))))

n = int(eval(input()))

a = list(map(float, input().split()))



# dp = [[None] * 1501 for i in range(3000)]

# def dfs(i=0, at=(n + 1) // 2):

#     if i == n:

#         return int(at <= 0)

#     at = max(at, 0)

#     if dp[i][at] is not None:

#         return dp[i][at]

#

#     r = dfs(i + 1, at - 1) * a[i] + dfs(i + 1, at) * (1 - a[i])

#     dp[i][at] = r

#     return r

# print(dfs())



dp = [[0] * 1501 for i in range(3000)]

dp[n][0] = 1

for i in reversed(list(range(n))):

    for at in reversed(list(range((n + 1) // 2 + 1))):

        r = dp[i + 1][max(0, at - 1)] * a[i] + dp[i + 1][at] * (1 - a[i])

        dp[i][at] = r



print((dp[0][(n + 1) // 2]))



import sys

sys.setrecursionlimit(10**6)
import functools
import operator

n = int(eval(input()))
p = list(map(float, input().split()))
half = n // 2 + 1
dp = [[None] * (n + 1) for _ in range(n + 1)]
# def dfs(n, depth=n - 1):
#     if depth < 0:
#         return 0
#
#     if dp[n][depth] is not None:
#         return dp[n][depth]
#
#     if n == 0:
#         r = functools.reduce(operator.mul, map(lambda x: 1 - x, p[:depth + 1]))
#     elif (n - 1) == depth:
#         r = functools.reduce(operator.mul, p[:depth + 1])
#     else:
#         r = dfs(n - 1, depth - 1) * p[depth] + dfs(n, depth - 1) * (1 - p[depth])
#     dp[n][depth] = r
#     return r
#
# print(sum(dfs(i) for i in range(half, n + 1)))
for i in range(0, n + 1):
    for depth in range(-1, n):
        if depth == -1:
            dp[i][depth] = 0
        elif i == 0:
            dp[i][depth] = functools.reduce(
                operator.mul, [1 - x for x in p[: depth + 1]]
            )
        elif (i - 1) == depth:
            dp[i][depth] = functools.reduce(operator.mul, p[: depth + 1])
        else:
            dp[i][depth] = dp[i - 1][depth - 1] * p[depth] + dp[i][depth - 1] * (
                1 - p[depth]
            )
print((sum(dp[i][n - 1] for i in range(half, n + 1))))

n = int(eval(input()))
a = list(map(float, input().split()))
# dp = [[None] * 1501 for i in range(3000)]
# def dfs(i=0, at=(n + 1) // 2):
#     if i == n:
#         return int(at <= 0)
#     at = max(at, 0)
#     if dp[i][at] is not None:
#         return dp[i][at]
#
#     r = dfs(i + 1, at - 1) * a[i] + dfs(i + 1, at) * (1 - a[i])
#     dp[i][at] = r
#     return r
# print(dfs())
dp = [[0] * 1501 for i in range(3000)]
dp[n][0] = 1
for i in reversed(list(range(n))):
    for at in reversed(list(range((n + 1) // 2 + 1))):
        r = dp[i + 1][max(0, at - 1)] * a[i] + dp[i + 1][at] * (1 - a[i])
        dp[i][at] = r
print((dp[0][(n + 1) // 2]))

-import sys - -sys.setrecursionlimit(10**6) -import functools -import operator - -p = list(map(float, input().split())) -half = n // 2 + 1 -dp = [[None] * (n + 1) for _ in range(n + 1)] -# def dfs(n, depth=n - 1): -#     if depth < 0: -#         return 0 +a = list(map(float, input().split())) +# dp = [[None] * 1501 for i in range(3000)] +# def dfs(i=0, at=(n + 1) // 2): +#     if i == n: +#         return int(at <= 0) +#     at = max(at, 0) +#     if dp[i][at] is not None: +#         return dp[i][at] -#     if dp[n][depth] is not None: -#         return dp[n][depth] -# -#     if n == 0: -#         r = functools.reduce(operator.mul, map(lambda x: 1 - x, p[:depth + 1])) -#     elif (n - 1) == depth: -#         r = functools.reduce(operator.mul, p[:depth + 1]) -#     else: -#         r = dfs(n - 1, depth - 1) * p[depth] + dfs(n, depth - 1) * (1 - p[depth]) -#     dp[n][depth] = r +#     r = dfs(i + 1, at - 1) * a[i] + dfs(i + 1, at) * (1 - a[i]) +#     dp[i][at] = r -# -# print(sum(dfs(i) for i in range(half, n + 1))) -for i in range(0, n + 1): -    for depth in range(-1, n): -        if depth == -1: -            dp[i][depth] = 0 -        elif i == 0: -            dp[i][depth] = functools.reduce( -                operator.mul, [1 - x for x in p[: depth + 1]] -            ) -        elif (i - 1) == depth: -            dp[i][depth] = functools.reduce(operator.mul, p[: depth + 1]) -        else: -            dp[i][depth] = dp[i - 1][depth - 1] * p[depth] + dp[i][depth - 1] * ( -                1 - p[depth] -            ) -print((sum(dp[i][n - 1] for i in range(half, n + 1)))) +# print(dfs()) +dp = [[0] * 1501 for i in range(3000)] +dp[n][0] = 1 +for i in reversed(list(range(n))): +    for at in reversed(list(range((n + 1) // 2 + 1))): +        r = dp[i + 1][max(0, at - 1)] * a[i] + dp[i + 1][at] * (1 - a[i]) +        dp[i][at] = r +print((dp[0][(n + 1) // 2]))