luogu#P4725. 【模板】多项式对数函数(多项式 ln)

    ID: 3706 远端评测题 2000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>数学洛谷原创O2优化导数积分快速傅里叶变换 FFT快速数论变换 NTT

【模板】多项式对数函数(多项式 ln)

Problem Description

Given a polynomial A(x)A(x) of degree n1n - 1, find a polynomial B(x)B(x) modulo xnx^n such that B(x)lnA(x)B(x) \equiv \ln A(x).

All computations are done modulo 998244353998244353, and ai[0,998244353)Za_i \in [0, 998244353) \cap \mathbb{Z}.

Input Format

The first line contains an integer nn.

The next line contains nn integers, which are the coefficients a0,a1,,an1a_0, a_1, \cdots, a_{n-1} of the polynomial in order.

It is guaranteed that a0=1a_0 = 1.

Output Format

Output nn integers, which are the coefficients a0,a1,,an1a_0, a_1, \cdots, a_{n-1} of the answer polynomial in order.

6
1 927384623 878326372 3882 273455637 998233543
0 927384623 817976920 427326948 149643566 610586717

Hint

For 100%100\% of the data, n105n \le 10^5.

Translated by ChatGPT 5