Recently brz has fallen for polynomials. He thinks if a polynomial $$$f(x)$$$ satisfies $$$f(a)=b$$$, it would be cool!
One day Mandy buy him a magic sequence $$$c$$$. He can't wait to apply his new polynomial theory to the sequence. Let polynomial $$$f(x)=a_0+a_1x+a_2x^2+\cdots$$$. He defines $$$G(f(x))$$$ as the number of pairs $$$(i,j)$$$ satisfying the following conditions:
Now he wants to know the sum of $$$G(f(x))$$$ where $$$f(x)$$$ satisfies that for all non-negative integer $$$k$$$, $$$a_k\geq 0,a_k\in \mathbb{Z}$$$.
However, the magic sequence can change itself. It will change one single element in it by $$$m$$$ times. brz wants to know the sum of $$$G(f(x))$$$ after every operation of the sequence.
Formally speaking, Let's say set $$$S$$$ contains all the polynomial that $$$\forall k,a_k\geq 0,a_k\in \mathbb{Z}$$$. You need to calculate $$$\sum_{f(x)\in S} G(f(x))$$$. Note that $$$|S|=\infty$$$.
Since the answer may be too large, you only need to find the answer module $$$998~244~353$$$.
The first line contains two integers $$$n~(1\leq n\leq 2\times 10^5),q~(1\leq q\leq 2\times 10^5)$$$, representing the length of $$$c$$$ and the number of operations of the sequence respectively.
The second line contains $$$n$$$ integers $$$c_i~(0\leq c_i\leq 10^9)$$$.
Each of the following $$$m$$$ lines contains two integer $$$x~(1\leq x\leq n),y~(0\leq y\leq 10^9)$$$, representing an operation that change the value of $$$c_x$$$ to $$$y$$$.
Print $$$m$$$ lines. Each line contains the sum of $$$G(f(x))$$$ after the previous operations.
2 3 2 3 2 2 1 1 2 1
2 1 0
| Name |
|---|


