AT_abc399_f [ABC399F] Range Power Sum
Description
You are given positive integers $ N, K $ , and an integer sequence of length $ N $ : $ A = (A_1, A_2, \dots, A_N) $ .
Find $ \displaystyle \sum_{1\leq l\leq r\leq N} \Bigg(\sum_{l\leq i\leq r} A_i\Bigg)^K $ , modulo $ 998244353 $ .
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ K $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
The value is $ A_1^2+A_2^2+A_3^2+(A_1+A_2)^2+(A_2+A_3)^2+(A_1+A_2+A_3)^2=3^2+1^2+2^2+4^2+3^2+6^2=75 $ .
### Sample Explanation 3
Be sure to find the sum modulo $ 998244353 $ .
### Constraints
- $ 1\leq N \leq 2\times 10^5 $
- $ 1\leq K \leq 10 $
- $ 0 \leq A_i < 998244353 $
- All input values are integers.