AtCoder Regular Contest 106
翻译中…
Problem Statement
翻译中…
Given are integer sequence of length $N$, $A = (A_1, A_2, \cdots, A_N)$, and an integer $K$.
翻译中…
For each $X$ such that $1 \le X \le K$, find the following value:
翻译中…
$\left(\displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} (A_L+A_R)^X\right) \bmod 998244353$
翻译中…
Constraints
翻译中…
- All values in input are integers.
$2 \le N \le 2 \times 10^5$$1 \le K \le 300$$1 \le A_i \le 10^8$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N K
A_1 A_2 \cdots A_N
翻译中…
Output
翻译中…
Print $K$ lines.
翻译中…
The $X$-th line should contain the value $\left(\displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} (A_L+A_R)^X \right) \bmod 998244353$.
翻译中…
样例
Input #1
3 3
1 2 3
Output #1
12
50
216
In the $1$-st line, we should print $(1+2)^1 + (1+3)^1 + (2+3)^1 = 3 + 4 + 5 = 12$.
In the $2$-nd line, we should print $(1+2)^2 + (1+3)^2 + (2+3)^2 = 9 + 16 + 25 = 50$.
In the $3$-rd line, we should print $(1+2)^3 + (1+3)^3 + (2+3)^3 = 27 + 64 + 125 = 216$.
Input #2
10 10
1 1 1 1 1 1 1 1 1 1
Output #2
90
180
360
720
1440
2880
5760
11520
23040
46080
Input #3
2 5
1234 5678
Output #3
6912
47775744
805306038
64822328
838460992
Be sure to print the sum modulo $998244353$.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。