#P5393. 下降幂多项式转普通多项式

    ID: 6023 远端评测题 4000ms 500MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>数学O2优化快速傅里叶变换 FFT快速数论变换 NTT

下降幂多项式转普通多项式

Background

This is a template problem.

Problem Description

You are given a falling-factorial polynomial $F(x)=\displaystyle\sum_{i=0}^{n-1}a_ix^{\underline{i}}$.

Find an ordinary polynomial G(x)=i=0n1bixiG(x)=\displaystyle\sum_{i=0}^{n-1}b_ix^i.

Such that G(x)=F(x)G(x)=F(x).

All operations are performed modulo 998244353998244353.

Input Format

The first line contains a positive integer nn, as described above.

The second line contains nn numbers, where the ii-th number represents ai1a_{i-1}.

Output Format

Output one line with nn numbers, where the ii-th number is bi1b_{i-1}.

3
1 2 1
1 1 1

Hint

For all testdata, ai[0,998244353)a_i\in\lbrack0,998244353).

This problem has 1010 subtasks.

Among them, 33 subtasks have n=2000n=2000.

The other 77 subtasks have n=200000n=200000.

Constraints

Translated by ChatGPT 5