#P6828. 任意模数 Chirp Z-Transform

任意模数 Chirp Z-Transform

Description

Given an nn-term polynomial P(x)P(x) and c,mc, m, compute P(c0),P(c1),,P(cm1)P(c^0), P(c^1), \dots, P(c^{m-1}). All answers are taken modulo 109+710^9+7.

Input Format

The first line contains three positive integers n,c,mn, c, m.
The second line contains nn non-negative integers a0,a1,,an1a_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(ci1)P(c^{i-1}).

6 108616 6
1 0 8 6 1 6
22 772456230 866731294 299746576 978045696 394365866

Hint

For 100%100\% of the testdata, 1n,m61051 \le n, m \le 6\cdot10^5, 0c,ai<109+70 \le c, a_i < 10^9+7.
| Test Point ID | Limits on n,mn, m | | :-----------: | :-----------: | | 11 | n=m=1000n=m=1000 | | 22 | n=m=64000n=m=64000 | | 33 | n=m=5105n=m=5\cdot10^5 | | 44 | n=5105,m=6105n=5\cdot10^5,m=6\cdot10^5 | | 55 | n=6105,m=5105n=6\cdot10^5,m=5\cdot10^5 |

The problem setter regrets that, due to precision and the limitations of Luogu’s built-in materials, it cannot be extended to 10610^6.
Hint: 77 FFT runs might not pass.
Hint: The problem setter did not use long double.

Translated by ChatGPT 5