Log of Formal Power Series

AC一覧

Problem Statement問題文

Given formal power series $f(x) = \sum_{i = 0}^{N - 1} a_i x^i$. Calculate first $N$ elements of $\log(f(x))$. In other words, print $g(x)$ s.t.

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

is satisfied.

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

となる $g(x)$ を出力してください

Constraints制約

• $1 \leq N \leq 500{,}000$
• $0 \leq a_i < 998{,}244{,}353$
• $a_0 = 1$

Input入力

$N$
$a_0$ $a_1$ ... $a_{N - 1}$


Output出力

$b_0$ $b_1$ ... $b_{N - 1}$


If we denote $g(x) = \sum_{i = 0}^{N - 1} b'_i x^i$, $b_i \equiv b'_i (\bmod 998{,}244{,}353)$ is satisfied.

ただし $g(x) = \sum_{i = 0}^{N - 1} b'_i x^i$ としたとき, $b_i \equiv b'_i (\bmod 998{,}244{,}353)$ とする

Sampleサンプル

# 1

5
1 1 499122179 166374064 291154613

0 1 2 3 4


Timelimit: 10 secs

Before submitting, please confirm terms and conditions