Problem A. Absolute
时间限制 1000 ms
内存限制 32 MB
Winter is here at the North and the White Walkers are close. There's a young Night Watch standing on the Wall.
The young Night Watch has created a method to keep his body warm. Every time he generate a random rational number x in range $[l_i, r_i]$ independently and uniformly, then he walks x meters to east.
Now he has n ranges $[l_1, r_1], [l_2, r_2] ... [l_n, r_n]$, He wants to know the expected distance to origin. If answer is a fraction $\frac{p}{q}$, output an integer $0 \leq s < 998244353$ so that $p \equiv sq~(mod~998244353)$.
输入数据
输出数据
Output the expected distance to origin in a line, modulo 998244353.
样例输入
样例输出
$ Mathjax font initiator $