AtCoder Beginner Contest 357-F
Problem
You are given sequences of length \(N\), \(A=(A_1,A_2,\ldots,A_N)\) and \(B=(B_1,B_2,\ldots,B_N)\).
You are also given \(Q\) queries to process in order.
There are three types of queries:
1 l r x
: Add \(x\) to each of \(A_l, A_{l+1}, \ldots, A_r\).2 l r x
: Add \(x\) to each of \(B_l, B_{l+1}, \ldots, B_r\).3 l r
: Print the remainder of \(\displaystyle\sum_{i=l}^r (A_i\times B_i)\) when divided by \(998244353\).