#P4725. Polynomial Logarithm Series
Polynomial Logarithm Series
Polynomial Logarithm Series
Given a polynomial (A(x)=a_0+a_1x+\cdots+a_{n-1}x^{n-1}) with (a_0=1) and each (a_i) an integer satisfying (0\le a_i<998244353), compute the polynomial (B(x)) modulo (x^n) such that
[
B(x)\equiv \ln A(x) \pmod{x^n}.
]
The computation is performed under the modulus (998244353).
A hint: You may use the relation
[
\frac{d}{dx}\ln A(x)=\frac{A'(x)}{A(x)}
]
by first computing the derivative (A'(x)), then finding the inverse of (A(x)) modulo (x^n) via Newton's iteration, multiplying them to obtain the derivative of (\ln A(x)), and finally integrating to recover (\ln A(x)).
Note: It is guaranteed that (a_0=1) so that (\ln A(x)) is well defined as a formal power series.
inputFormat
The first line contains a positive integer (n) ((1\le n\le 10^5)), the number of coefficients of polynomial (A(x)).
The second line contains (n) space-separated integers (a_0,a_1,\dots,a_{n-1}) representing the coefficients of (A(x)) in increasing order of degree. It is guaranteed that (a_0=1).
outputFormat
Output (n) space-separated integers representing the coefficients of the polynomial (B(x)=\ln A(x)) modulo (998244353), from the constant term up to the ((n-1))th term.
sample
3
1 1 1
0 1 499122177