#P6613. Coefficient Extraction in a Differential Polynomial Equation

    ID: 19822 Type: Default 1000ms 256MiB

Coefficient Extraction in a Differential Polynomial Equation

Coefficient Extraction in a Differential Polynomial Equation

Given three polynomials \(F(x)\), \(A(x)\) and \(B(x)\) satisfying the differential equation

[ \frac{dF(x)}{dx} \equiv A(x)e^{F(x)-1} + B(x) \pmod{x^n}, ]

with the initial condition \(F(0)=1\), compute the first \(n\) coefficients of \(F(x)\). The answer should be given modulo \(998244353\).

The exponential function in the equation must be interpreted in its power series expansion (in \(x\)) and all formal power series operations are done modulo \(x^n\). In other words, if

[ F(x)=f_0+f_1x+f_2x^2+\cdots+f_{n-1}x^{n-1}]

with (f_0=1), then you are to determine (f_0, f_1, \ldots, f_{n-1}) such that the coefficient of (x^r) (for (0 \le r < n)) in

[ \frac{dF(x)}{dx}]

matches the coefficient of (x^r) in

[ A(x)e^{F(x)-1} + B(x). ]

inputFormat

The input begins with three integers \(n\), \(d_A\) and \(d_B\) where \(n\) is the number of coefficients to compute for \(F(x)\), \(d_A\) is the degree of polynomial \(A(x)\) and \(d_B\) is the degree of polynomial \(B(x)\).

The next line contains \(d_A+1\) integers representing the coefficients of \(A(x)\) in increasing order (from the constant term to the \(x^{d_A}\) term), and the following line contains \(d_B+1\) integers representing the coefficients of \(B(x)\) in increasing order.

outputFormat

Output \(n\) integers, which are the coefficients \(f_0, f_1, \ldots, f_{n-1}\) of \(F(x)\) modulo \(998244353\). The coefficients should be printed in order separated by spaces.

sample

3 1 1
1 2
0 1
1 1 2

</p>