You generate real numbers s _{1}, s _{2}, ..., s _{ n} as follows:
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 , where P and Q are coprime integers, and . Print the value of P·Q ^{ - 1} modulo 998244353.
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).
Print a single integer, the answer to the problem.
4
1.00
2
3.000000
4.0
1
1
0.50216
342677322
2
0.5
1.0
623902721
6
0.77
1.234567
2.1
1.890
2.9999
3.77
859831967
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.
Name |
---|