P5667 Lagrange Interpolation 2

Description

Given the $n + 1$ point values $f(0), f(1) \dots f(n)$ of a polynomial of degree at most $n$, and a positive integer $m$, find $f(m), f(m + 1) \dots f(m + n)$. The answer should be taken modulo $998244353$.

Input Format

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

Output Format

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

Explanation/Hint

Constraints For $100\%$ of the testdata: $1 \le n \le 160000$, $n < m \le 10^8$, $0 \le f(i) < 998244353$. Translated by ChatGPT 5