#abc221h. H - Count Multiset
H - Count Multiset
Score : points
## 问题描述
给定正整数 $N$ 和 $M$。
对于每个 $k=1,2,\ldots,N$,求满足以下条件的多集合 $A$ 的个数,并以模 $998244353$ 的结果输出:
- 包含 $k$ 个正整数的多集合 $A$ 满足以下两个条件:
- 多集合 $A$ 中元素之和为 $N$;
- 对于任意正整数 $x$,多集合 $A$ 中最多包含 $x$ 出现 $M$ 次。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Given are positive integers and .
For each , find the following number and print it modulo .
- The number of multisets containing positive integers that satisfy both of the following conditions:
- the sum of the elements of is ;
- for every positive integer , contains at most occurrences of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines; the -th line should contain the answer for the case .
Sample Input 1
4 2
Sample Output 1
1
2
1
0
- For , there is one multiset that satisfies the conditions: .
- For , there are two multisets that satisfy the conditions: and .
- For , there is one multiset that satisfies the conditions: .
- For , there is no multiset that satisfies the conditions.
Sample Input 2
7 7
Sample Output 2
1
3
4
3
2
1
1
update @ 2024/3/10 09:46:06