AtCoder Beginner Contest 230
H
Bullion
AtCoder
⌀ 3528
原题
← G→
翻译中…

Problem Statement

翻译中…

Takahashi won a claw machine competition and was awarded "all-you-can-stuff" gold blocks. There are unlimited numbers of blocks weighing $w_1, w_2, \dots, w_K$ kilograms each, and an unlimited number of bags weighing $1$ kilogram each to stuff them.

翻译中…

Takahashi can bring home one non-empty bag. A bag can contain zero or more other non-empty bags and zero or more gold blocks.

翻译中…

After arranging a truck with a load capacity of $W$ kilograms, he gets interested in the number of ways to stuff gold blocks and bring home a bag that weighs $w$ kilograms in total for $w = 2, 3, \dots, W$. Find the number, modulo $998244353$, of possible states of the bag for each $w = 2, 3, \dots, W$. Here,

翻译中…
  • two gold blocks are said to be the same when their weights are the same;
  • two bags are said to be in the same state when the two multisets whose elements are the bags and gold blocks in the two bags are the same.
翻译中…

Constraints

翻译中…
  • $2 \leq W \leq 2.5 \times 10^5$
  • $1 \leq K \leq W$
  • $1 \leq w_i \leq W$ $(1 \leq i \leq K)$
  • $i \neq j \to w_i \neq w_j$ $(1 \leq i,j \leq K)$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

W K
w_1 w_2 \dots w_K

翻译中…

Output

翻译中…

Print the answer in $W - 1$ lines. The $i$-th line should contain the count for $w = i + 1$.

翻译中…

样例

Input #1
4 1
1
Output #1
1
2
4
The figure below enumerates the possible states of the bag for $w = 2, 3, 4$. (A circle represents a bag.) ![image](https://img.atcoder.jp/ghi/5e1a4298e8b0992c767932915c7e93f4.png)
Input #2
10 10
1 2 3 4 5 6 7 8 9 10
Output #2
1
3
7
18
45
121
325
904
2546
题目信息
题号
abc230_h
时间限制
8 s
内存限制
1024 MB

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