Problem9000--[yosupo] Enumerative Combinatorics - $\#_p$ ​Subset Sum

9000: [yosupo] Enumerative Combinatorics - $\#_p$ ​Subset Sum

[Creator : ]
Time Limit : 3.000 sec  Memory Limit : 512 MiB

Description

Given $N$ positive integers $s_0,s_1,\ldots,s_{N-1}$ and a positive integer $T$.
For each $t=1,2,...,T$, count the number of subset $I \subseteq \\{0,1,...,N-1\\}$ s.t. $\sum_{i \in I} s_i=t$ and print it $\bmod {998244353}$ (we denote it as $p_t$).

Input

$N$ $T$
$s_0$ $s_1$ ... $s_{N-1}$

Output

$p_1$ $p_2$ ... $p_T$

Constraints

$1 \leq N \leq 10^6$
$1 \leq T \leq 5 \times 10^5$
$1 \leq s_i \leq T$

Sample 1 Input

5 3
1 1 2 2 3

Sample 1 Output

2 3 5

HINT

相同题目:yosupo

Source/Category