キーエンスプログラミングコンテスト2023夏(AtCoder Beginner Contest 315)
Ex
Typical Convolution Problem
AtCoder
⌀ 2807
原题
←G →
翻译中…

Problem Statement

翻译中…

You are given a sequence $(A_1, A_2, \ldots , A_N)$. Let us define a sequence $(F_0, F_1, \ldots , F_N)$ by the following formulae.

翻译中…
  • $F_0 = 1$
  • $F_n = A_n\displaystyle\sum_{i+j<n}F_iF_j$ $(1 \leq n \leq N)$
翻译中…

Find $F_1, \ldots , F_N$ modulo $998244353$.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 2 \times 10^5$
  • $0 \leq A_i < 998244353$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N
A_1 A_2 \ldots A_N

翻译中…

Output

翻译中…

Print $F_1, \ldots , F_N$ modulo $998244353$ in this order, with spaces in between.

翻译中…

样例

Input #1
5
1 2 3 4 5
Output #1
1 6 48 496 6240
$F_1 = A_1F_0F_0 = 1$. $F_2 = A_2(F_0F_0+F_0F_1+F_1F_0) = 6$. Similarly, we find $F_3 = 48, F_4 = 496, F_5 = 6240$.
Input #2
3
12345 678901 2345678
Output #2
12345 790834943 85679169
题目信息

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。