No.2763 Macaron Gift Box
タグ : / 解いたユーザー数 47
作問者 : 👑
aplysiaSheep
Problem Statement
The binap pastry shop sells $N$ types of macarons, macaron $1$ through macaron $N$. There are $K$ of each macaron in stock, and macaron $i$ ( $1 \leq i \leq N$ ) costs $i$ yen. Macarons of the same type are indistinguishable from each other.
Solve the following problem for each of $X = 1, \ldots, N$.
- Find the number of ways to buy macarons so that their total price is exactly $X$ yen.
Since the answer can be very large, find the remainder when it is divided by the prime $998244353$.
Input
$N$ $K$
$1 \leq K \leq N \leq 2 \times 10^5$
All inputs are integers.
Output
$Ans_1$ $Ans_2$ $\dots$ $Ans_N$
Output the answers for $X=1,\ldots,N$ in this order, each ${\rm mod}\ 998244353$, separated by spaces.
Print a newline at the end.
Sample
Sample 1
Input
4 2
Output
1 2 2 4
For example, when $X = 4$, there are the following
- $2$ of macaron $1$ and $1$ of macaron $2$.
- $1$ of macaron $1$ and $1$ of macaron $3$.
- $2$ of macaron $2$.
- $1$ of macaron $4$.
$4$ ways.
Note that macarons of the same type are not distinguished when counting.
Sample 2
Input
13 5
Output
1 2 3 5 7 10 14 20 27 37 49 65 85
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。