409061: GYM103428 G Shinyruo and KFC

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Shinyruo and KFCtime limit per test3.0 smemory limit per test256 megabytesinputstandard inputoutputstandard output

During your participation in this competition, Shinyruo is preparing to order KFC for the offline competition next week.

There are $$$n$$$ kinds of foods in KFC, and he plans to order $$$a_i$$$ number of the $$$i$$$-th food for every $$$i \in [1,n]$$$. Due to shortage of manpower, the total number of all kinds of foods is no larger than $$$10^5$$$.

After the competition, he will hand all the KFC out to $$$k$$$ teams. Each team can get different kinds of foods but for each kind it can get one at most.

Now Shinyruo wants to know the number of ways to hand the desserts out. As he doesn't know the number of participating teams, you need to calculate the answers for $$$k=1,2,\cdots,m$$$.

As the answer can be large, print it modulo $$$998244353$$$.

Input

The first line contains two integers $$$n,m$$$. ($$$1 \le m,n \le 5 \cdot 10^4$$$)

The second line contains $$$n$$$ integers $$$a_1,\cdots,a_n$$$. ($$$0\le a_i\le 10^5,\ \sum_{i=1}^n a_i\le 10^5$$$)

Output

$$$m$$$ lines each contains one integer. The $$$i$$$-th integer indicates the answer of $$$k=i$$$ modulo $$$998244353$$$.

ExampleInput
4 6
0 1 2 3
Output
0
0
9
96
500
1800

加入题单

算法标签: