AT_aalc001_g k 乗和

Description

You are given a sequence of nonnegative integers $ A=(A_1,A_2,\ldots,A_N) $ of length $ N $ . Process $ Q $ queries. Each query is of one of the following $ 2 $ types: - `1 l r x`: For each $ i=l,l+1,\ldots,r $ , add $ x $ to $ A_i $ . - `2 l r k`: Print $ \displaystyle \sum_{i=l}^{r} A_i^k $ modulo $ 998244353 $ .

Input Format

The input is given from Standard Input in the following format: > $ N $ $ Q $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $ $ \mathrm{query}_1 $ $ \mathrm{query}_2 $ $ \vdots $ $ \mathrm{query}_Q $ Each query is given in one of the following formats: > $ 1 $ $ l $ $ r $ $ x $ > $ 2 $ $ l $ $ r $ $ k $

Output Format

Let $ q $ be the number of type $ 2 $ queries. Print $ q $ lines. The $ j $ -th line should contain the answer to the $ j $ -th type $ 2 $ query.

Explanation/Hint

### Sample Explanation 1 For query $ 1 $ , print $ 1+2+3+4=10 $ . After query $ 3 $ , $ A=(1,7,8,4) $ . Therefore, for query $ 4 $ , print $ 1^3+7^3+8^3=856 $ . ### Constraints - $ 1 \leq N \leq 2 \times 10^5 $ - $ 1 \leq Q \leq 2 \times 10^5 $ - $ 0 \leq A_i \leq 10^9 $ - For type $ 1 $ queries, $ 1 \leq l \leq r \leq N $ , $ 0 \leq x \leq 10^9 $ - For type $ 2 $ queries, $ 1 \leq l \leq r \leq N $ , $ 1 \leq k \leq 4 $ - All numerical values in the input are integers.