#P5667. 拉格朗日插值2

    ID: 6414 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>快速傅里叶变换 FFT快速数论变换 NTT拉格朗日插值法

拉格朗日插值2

Problem Description

Given the n+1n + 1 point values f(0),f(1)f(n)f(0), f(1) \dots f(n) of a polynomial of degree at most nn, and a positive integer mm, find f(m),f(m+1)f(m+n)f(m), f(m + 1) \dots f(m + n).

The answer should be taken modulo 998244353998244353.

Input Format

The first line contains two positive integers n,mn, m, with the meanings as described above.
The second line contains n+1n + 1 integers, representing f(0),f(1)f(n)f(0), f(1) \dots f(n).

Output Format

Output one line with n+1n + 1 integers, representing f(m),f(m+1)f(m+n)f(m), f(m + 1) \dots f(m + n).

5 6
1 1 4 5 1 4
54 232 673 1579 3232 6007

Hint

Constraints
For 100%100\% of the testdata:
1n1600001 \le n \le 160000, n<m108n < m \le 10^8, 0f(i)<9982443530 \le f(i) < 998244353.

Translated by ChatGPT 5