#P6800. 【模板】Chirp Z-Transform

【模板】Chirp Z-Transform

Problem Description

Given an nn-term polynomial P(x)P(x) and c,mc, m, compute P(c0),P(c1),…,P(cm−1)P(c^0), P(c^1), \dots, P(c^{m-1}). All answers are taken modulo 998244353998244353.

Input Format

The first line contains three positive integers n,c,mn, c, m.
The second line contains nn non-negative integers a0,a1,…,an−1a_0, a_1, \dots, a_{n-1}, representing the coefficients of P(x)P(x) from low degree to high degree.

Output Format

Output one line with mm positive integers. The ii-th number represents P(ci−1)P(c^{i-1}).

3 3 3
3 3 3
9 39 273

Hint

For 100%100\% of the testdata, 1≤n,m≤1061 \le n, m \le 10^6, 0≤c,ai<9982443530 \le c, a_i < 998244353.

Translated by ChatGPT 5