#P4238. 【模板】多项式乘法逆

    ID: 3169 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>数学递推倍增递归逆元快速傅里叶变换 FFT

【模板】多项式乘法逆

Description

{{Given a polynomial F(x)F(x), find a polynomial G(x)G(x) such that F(x)G(x)1(modxn)F(x) * G(x) \equiv 1 \pmod{x^n}. Coefficients are taken modulo 998244353.}}

Input Format

{{First, input an integer nn, indicating the number of terms of the input polynomial.
Then input nn integers; the ii-th integer aia_i denotes the coefficient of the term of F(x)F(x) with degree i1i-1.}}

Output Format

{{Output nn integers; the ii-th integer bib_i denotes the coefficient of the term of G(x)G(x) with degree i1i-1. It is guaranteed that a solution exists.}}

5
1 6 3 4 9
1 998244347 33 998244169 1020

Hint

{{For 100%100\% of the testdata, 1n1051 \leq n \leq 10^5, 0ai1090 \leq a_i \leq 10^9.}}

Translated by ChatGPT 5