{"problem":{"name":"H. Don't Exceed","description":{"content":"You generate real numbers _s_1, _s_2, ..., _s__n_ as follows: *   _s_0 = 0; *   _s__i_ = _s__i_ - 1 + _t__i_, where _t__i_ is a real number chosen independently uniformly at random between 0 and 1, i","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF913H"},"statements":[{"statement_type":"Markdown","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.\n\n## Input\n\nThe 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_).\n\n## Output\n\nPrint a single integer, the answer to the problem.\n\n[samples]\n\n## Note\n\nIn 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.","is_translate":false,"language":"English"},{"statement_type":"Markdown","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$。\n\n## Input\n\n第一行包含整数 $n$（$1 \\le n \\le 30$）。接下来 $n$ 行包含实数 $x_1, x_2, \\dots, x_n$，小数点后最多六位数字（$0 < x_i \\le n$）。\n\n## Output\n\n输出一个整数，表示问题的答案。\n\n[samples]\n\n## Note\n\n在第一个示例中，所求概率为 1，因为不超过 1 的 $i$ 个实数之和不会超过 $i$。在第二个示例中，概率就是 $x_1$ 本身。在第三个示例中，所求概率为 $3 / 8$。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"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 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF913H","tags":["math","probabilities"],"sample_group":[["4\n1.00\n2\n3.000000\n4.0","1"],["1\n0.50216","342677322"],["2\n0.5\n1.0","623902721"],["6\n0.77\n1.234567\n2.1\n1.890\n2.9999\n3.77","859831967"]],"created_at":"2026-03-03 11:00:39"}}