#abc221h. [abc221_h]Count Multiset
[abc221_h]Count Multiset
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