Logarithm and exponential Taylor polynomials (Small)
Time limit1.5sMemory limit512 MB
Given a polynomial P(x) with zero constant term and degree at most n, print the Taylor coefficients of ln(1+P(x)) and e^(P(x))-1 modulo 998244353.
- Level
Medium5 of 10
- Topics
- Math, Dynamic programming
- Solved
- No attempts yet
Problem
The -th Taylor polynomial of a function at is
A polynomial has degree at most , has constant term , and is given as . Compute the -th Taylor polynomials of and .
Input
The first line contains an integer ().
The second line contains integers (, ).
Output
On the first line, print the coefficients of the -th Taylor polynomial of in ascending order of degree.
On the second line, print the coefficients of the -th Taylor polynomial of in ascending order of degree.
Every coefficient is a rational number, so it can be written as an irreducible fraction . Print for each coefficient.