{"problem":{"name":"Coins","description":{"content":"Let $N$ be a positive odd number. There are $N$ coins, numbered $1, 2, \\ldots, N$. For each $i$ ($1 \\leq i \\leq N$), when Coin $i$ is tossed, it comes up heads with probability $p_i$ and tails with pr","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"dp_i"},"statements":[{"statement_type":"Markdown","content":"Let $N$ be a positive odd number.\nThere are $N$ coins, numbered $1, 2, \\ldots, N$. For each $i$ ($1 \\leq i \\leq N$), when Coin $i$ is tossed, it comes up heads with probability $p_i$ and tails with probability $1 - p_i$.\nTaro has tossed all the $N$ coins. Find the probability of having more heads than tails.\n\n## Constraints\n\n*   $N$ is an odd number.\n*   $1 \\leq N \\leq 2999$\n*   $p_i$ is a real number and has two decimal places.\n*   $0 < p_i < 1$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$p_1$ $p_2$ $\\ldots$ $p_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"dp_i","tags":[],"sample_group":[["3\n0.30 0.60 0.80","0.612\n\nThe probability of each case where we have more heads than tails is as follows:\n\n*   The probability of having $(Coin 1, Coin 2, Coin 3) = (Head, Head, Head)$ is $0.3 × 0.6 × 0.8 = 0.144$;\n*   The probability of having $(Coin 1, Coin 2, Coin 3) = (Tail, Head, Head)$ is $0.7 × 0.6 × 0.8 = 0.336$;\n*   The probability of having $(Coin 1, Coin 2, Coin 3) = (Head, Tail, Head)$ is $0.3 × 0.4 × 0.8 = 0.096$;\n*   The probability of having $(Coin 1, Coin 2, Coin 3) = (Head, Head, Tail)$ is $0.3 × 0.6 × 0.2 = 0.036$.\n\nThus, the probability of having more heads than tails is $0.144 + 0.336 + 0.096 + 0.036 = 0.612$."],["1\n0.50","0.5\n\nOutputs such as `0.500`, `0.500000001` and `0.499999999` are also considered correct."],["5\n0.42 0.01 0.42 0.99 0.42","0.3821815872"]],"created_at":"2026-03-03 11:01:14"}}