P29058 [洛谷] 【Template】Polynomial Composite Inverse
省选
题目描述

Problem Description

Given a polynomial \( F(x) = \sum_{i=0}^{n-1} a_i x^i \) of degree \( n-1 \).

You are provided with \( n \) and the coefficients of \( F(x) \). Your task is to find a polynomial \( G(x) \) of degree \( n-1 \) such that:

\[ G(F(x)) \equiv x \pmod{x^n} \]

Output the coefficients of \( G(x) \) modulo \( 998244353 \).

It is guaranteed that \( a_0 = 0 \) and \( a_1 \neq 0 \).

Input Format

The first line contains a positive integer \( n \).

The second line contains \( n \) non-negative integers \( a_0, a_1, a_2, \ldots, a_{n-1} \), where \( a_i \) represents the coefficient of the \( i \)-th term of \( F(x) \). It is guaranteed that \( a_0 = 0 \) and \( a_1 \neq 0 \).

Output Format

Output one line containing \( n \) non-negative integers, where the \( i \)-th integer represents the coefficient of the \( (i-1) \)-th term of \( G(x) \).

Sample Input and Output

Sample Input #1

6
0 1 2 2 4 3

Sample Output #1

0 1 998244351 6 998244329 113

Sample Input #2

7
0 1 1 4 5 1 4

Sample Output #2

0 1 998244352 998244351 10 7 998244202

Notes

For \( 100\% \) of the data, \( 2 \leq n \leq 2^{14} \), and \( 0 \leq a_i < 998,244,353 \).

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
6 0 1 2 2 4 3
样例输出
0 1 998244351 6 998244329 113