Hello 2018
H
Don't Exceed
Codeforces
3400
原题
← G→
翻译中…

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, inclusive.
翻译中…

You 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.

翻译中…

It can be shown that this can be represented as image, where $*P*$ and $*Q*$ are coprime integers, and image. Print the value of $*P*·*Q*^{ - 1}$ modulo $998244353$.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1 ≤ *n* ≤ 30$).

翻译中…

The 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*$).

翻译中…

Output

翻译中…

Print a single integer, the answer to the problem.

翻译中…

Note

翻译中…

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*$.

翻译中…

In the second example, the probability is $*x*_{1}$ itself.

翻译中…

In the third example, the sought probability is $3 / 8$.

翻译中…

样例

Input #1
4
1.00
2
3.000000
4.0
Output #1
1
InputCopy OutputCopy
Input #2
1
0.50216
Output #2
342677322
InputCopy OutputCopy
Input #3
2
0.5
1.0
Output #3
623902721
InputCopy OutputCopy
Input #4
6
0.77
1.234567
2.1
1.890
2.9999
3.77
Output #4
859831967
InputCopy OutputCopy
题目信息
题号
913H
所属比赛
时间限制
4 s
内存限制
256 MB
标签
数学
概率论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。