{"raw_statement":[{"iden":"statement","content":"You generate real numbers _s_1, _s_2, ..., _s__n_ as follows:\n\n*   _s_0 = 0;\n*   _s__i_ = _s__i_ - 1 + _t__i_, where _t__i_ is a real number chosen independently uniformly at random between 0 and 1, inclusive.\n\nYou are given real numbers _x_1, _x_2, ..., _x__n_. You are interested in the probability that _s__i_ ≤ _x__i_ is true for all _i_ simultaneously.\n\nIt can be shown that this can be represented as , where _P_ and _Q_ are coprime integers, and . Print the value of _P_·_Q_ - 1 modulo 998244353."},{"iden":"input","content":"The first line contains integer _n_ (1 ≤ _n_ ≤ 30).\n\nThe next _n_ lines contain real numbers _x_1, _x_2, ..., _x__n_, given with at most six digits after the decimal point (0 < _x__i_ ≤ _n_)."},{"iden":"output","content":"Print a single integer, the answer to the problem."},{"iden":"examples","content":"Input\n\n4\n1.00\n2\n3.000000\n4.0\n\nOutput\n\n1\n\nInput\n\n1\n0.50216\n\nOutput\n\n342677322\n\nInput\n\n2\n0.5\n1.0\n\nOutput\n\n623902721\n\nInput\n\n6\n0.77\n1.234567\n2.1\n1.890\n2.9999\n3.77\n\nOutput\n\n859831967"},{"iden":"note","content":"In the first example, the sought probability is 1 since the sum of _i_ real numbers which don't exceed 1 doesn't exceed _i_.\n\nIn the second example, the probability is _x_1 itself.\n\nIn the third example, the sought probability is 3 / 8."}],"translated_statement":[{"iden":"statement","content":"你按如下方式生成实数序列 $[s_1, s_2, \\dots, s_n]$：\n\n给定实数 $[x_1, x_2, \\dots, x_n]$。你关心的是对所有 $i$ 同时满足 $s_i \\le x_i$ 的概率。\n\n可以证明，该概率可以表示为 $\\frac{P}{Q}$，其中 $P$ 和 $Q$ 是互质的整数，且 $Q > 0$。请输出 $P \\cdot Q^{-1}$ 对 $998244353$ 取模的值。\n\n第一行包含整数 $n$（$1 \\le n \\le 30$）。\n\n接下来 $n$ 行包含实数 $x_1, x_2, \\dots, x_n$，小数点后最多六位数字（$0 < x_i \\le n$）。\n\n输出一个整数，表示问题的答案。\n\n在第一个示例中，所求概率为 1，因为不超过 1 的 $i$ 个实数之和不会超过 $i$。\n\n在第二个示例中，概率就是 $x_1$ 本身。\n\n在第三个示例中，所求概率为 $3 / 8$。"},{"iden":"input","content":"第一行包含整数 $n$（$1 \\le n \\le 30$）。接下来 $n$ 行包含实数 $x_1, x_2, \\dots, x_n$，小数点后最多六位数字（$0 < x_i \\le n$）。"},{"iden":"output","content":"输出一个整数，表示问题的答案。"},{"iden":"examples","content":"输入\n4\n1.002\n3.000000\n4.0\n输出\n1\n\n输入\n1\n0.50216\n输出\n342677322\n\n输入\n2\n0.5\n1.0\n输出\n623902721\n\n输入\n6\n0.77\n1.234567\n2.1\n1.890\n2.9999\n3.77\n输出\n859831967"},{"iden":"note","content":"在第一个示例中，所求概率为 1，因为不超过 1 的 $i$ 个实数之和不会超过 $i$。在第二个示例中，概率就是 $x_1$ 本身。在第三个示例中，所求概率为 $3 / 8$。"}],"sample_group":[],"show_order":[],"formal_statement":"Let $ n \\in \\mathbb{N} $, $ 1 \\leq n \\leq 30 $.\n\nGiven real numbers $ x_1, x_2, \\dots, x_n \\in (0, n] $, each with at most six decimal digits.\n\nLet $ s_1, s_2, \\dots, s_n $ be independent uniform random variables on $ [0,1] $.\n\nDefine the event $ A = \\bigcap_{i=1}^n \\left\\{ \\sum_{j=1}^i s_j \\leq x_i \\right\\} $.\n\nThe probability $ \\mathbb{P}(A) $ is a rational number $ \\frac{P}{Q} $, where $ P, Q \\in \\mathbb{Z} $, $ \\gcd(P, Q) = 1 $, $ Q > 0 $.\n\nCompute $ (P \\cdot Q^{-1}) \\mod 998244353 $, where $ Q^{-1} $ is the modular inverse of $ Q $ modulo $ 998244353 $.","simple_statement":null,"has_page_source":false}