QOJ.ac

QOJ

Time Limit: 5 s Memory Limit: 2048 MB Total points: 10 Hackable ✓

#1098. Polynomial Compositional Inverse

Statistics

Given a formal power series $F(x) = \displaystyle \sum_{i=0}^{n-1} f_ix^i$, satisfying $f_0 = 0$ and $f_1 \ne 0$. You need to find $G(x)$ such that $F(G(x)) \equiv x \pmod{x^n}$, and return the coefficients of $G$ modulo $998\,244\,353$.

Input

The first line contains an integer $N$.

The next line contains $N$ integers $f_0, f_1, \cdots, f_{n-1}$. It is guaranteed that $f_0 = 0$, $f_1 \ne 0$, and $0 \leq f_i < 998\,244\,353$ for each $i$.

Output

Output one line containing $N$ integers $g_0, g_1, \cdots, g_{n-1}$.

Examples

Input 1

6
0 9 0 2 2 8

Output 1

0 443664157 0 842292446 315420128 301682335

Subtasks

For all data, we have $1 \leq N \leq 200\,000$.

Subtask $N \leq $
$1$ $10$
$2$ $1\,000$
$3$ $3\,000$
$4$ $5\,000$
$5$ $10\,000$
$6$ $25\,000$
$7$ $50\,000$
$8$ $100\,000$
$9$ $150\,000$
$10$ $200\,000$

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.