TopCoder

User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

50.0% (1/2)

Tags

Description

You are given a formal power series $f(x) = \sum_ {i=0}^ {N-1} a_ i x^ i \in \mathbb{Q}[[x]]$ with $a_ 0 = 0$.
Calculate the first $N$ terms of $\exp(f(x)) = \sum_ {i=0}^ {\infty} b_ i x^ i$.
In other words, find $g(x) = \sum_ {i=0}^ {N-1} b_ i x^ i \in \mathbb{Q}[[x]]$ such that

$$g(x) \equiv \sum_ {k=0}^ {N-1} \frac{f(x)^ k}{k!} \pmod{x^ N}.$$

Print the coefficients modulo $998244353$.

Input Format

$N$
$a_ 0$ $a_ 1$ $\cdots$ $a_ {N - 1}$

Output Format

$b_ 0$ $b_ 1$ $\cdots$ $b_ {N - 1}$

Sample Input 1

5
0 1 2 3 4

Sample Output 1

1 1 499122179 166374064 291154613

Hints

  • $1 \leq N \leq 5 \times 10^ {5}$
  • $0 \leq a_ i < 998244353$
  • $a_ 0 = 0$

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 2097152 2097152
1 10000 2097152 2097152
2 10000 2097152 2097152
3 10000 2097152 2097152
4 10000 2097152 2097152
5 10000 2097152 2097152
6 10000 2097152 2097152
7 10000 2097152 2097152
8 10000 2097152 2097152
9 10000 2097152 2097152
10 10000 2097152 2097152
11 10000 2097152 2097152
12 10000 2097152 2097152
13 10000 2097152 2097152
14 10000 2097152 2097152
15 10000 2097152 2097152
16 10000 2097152 2097152
17 10000 2097152 2097152
18 10000 2097152 2097152
19 10000 2097152 2097152
20 10000 2097152 2097152
21 10000 2097152 2097152
22 10000 2097152 2097152
23 10000 2097152 2097152
24 10000 2097152 2097152
25 10000 2097152 2097152