Naniwazu-kun is going to take on the traditional kendama challenge in a New Year's Eve music program. If at least $$$K$$$ people succeed consecutively, the record will be broken. To maximize the probability of success as much as possible, he decided to challenge it with a team of $$$N$$$ carefully selected players.
The $$$N$$$ players will attempt the kendama in order from the $$$1$$$-st to the $$$N$$$-th. The probability that the $$$i$$$-th player $$$(1 \leq i \leq N)$$$ succeeds is $$$\frac{A_i}{B_i}$$$, and each player's success or failure is independent.
Find the probability that there exists at least one segment where $$$K$$$ or more consecutive players succeed, modulo $$$998244353$$$.
In the first line, integers $$$N, K$$$ are given separated by a space. ($$$1 \leq K \leq N \leq 2 \times 10^5$$$)
In the following $$$N$$$ lines, the $$$i$$$-th line contains integers $$$A_i, B_i$$$ separated by a space. ($$$1 \leq A_i \leq B_i \leq 998244352$$$)
Output the probability modulo $$$998244353$$$ in a single line.
2 21 11 2
499122177
5 41 11 11 11 11 10000
1
5 33 141 592 653 589 79
62790646
For the first example:
Let S denote the event that player $$$i$$$ succeeds, and F denote the event that player $$$i$$$ fails.
The possible patterns and their probabilities are as follows:
Only SS contains a segment where at least $$$2$$$ players succeed consecutively, and its probability is $$$\frac{1}{2}$$$.
Since $$$499122177 \times 2 \equiv 1 \pmod{998244353}$$$, output $$$499122177$$$.
For the second example:
Even if Naniwazu-kun, who performs last, is not very skilled, it is fine as long as the helpers are reliable.
It can be proven that the required probability is always a rational number. Under the constraints of this problem, when the probability is expressed as a reduced fraction $$$\frac{y}{x}$$$, it is guaranteed that $$$x$$$ is not divisible by $$$998244353$$$.
In this case, there exists a unique integer $$$z$$$ with $$$0 \leq z \leq 998244352$$$ such that $$$xz \equiv y \pmod{998244353}$$$. Output this $$$z$$$.