#D. ARC106D - Powers

    Type: Default 3000ms 512MiB

ARC106D - Powers

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Score : 600 points

Problem Statement

Given are integer sequence of length N, A=(A1,A2,,AN), and an integer K.

For each X such that 1XK, find the following value:

(L=1N1R=L+1N(AL+AR)X)mod998244353

Constraints

  • All values in input are integers.
  • 2N2×105
  • 1K300
  • 1Ai108

Input

Input is given from Standard Input in the following format:

N K
A1 A2  AN

Output

Print K lines.

The X-th line should contain the value (L=1N1R=L+1N(AL+AR)X)mod998244353.


Sample Input 1

3 3
1 2 3

Sample 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.


Sample Input 2

10 10
1 1 1 1 1 1 1 1 1 1

Sample Output 2

90
180
360
720
1440
2880
5760
11520
23040
46080

Sample Input 3

2 5
1234 5678

Sample Output 3

6912
47775744
805306038
64822328
838460992

Be sure to print the sum modulo 998244353.

ARC106

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2023-7-5 8:15
End at
2023-7-5 10:15
Duration
2 hour(s)
Host
Partic.
13