atcoder#ARC102C. [ARC102E] Stop. Otherwise...
[ARC102E] Stop. Otherwise...
Score : points
Problem Statement
Takahashi throws dice, each having sides with all integers from to . The dice are NOT pairwise distinguishable. For each , find the following value modulo :
- The number of combinations of sides shown by the dice such that the sum of no two different sides is .
Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer such that the number of dice showing is different in those two.
Constraints
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print integers. The -th of them should be the answer for .
3 3
7
7
4
7
7
- For , the combinations $(1,2,2),(1,2,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3)$ satisfy the condition, so the answer is .
- For , the combinations $(1,1,1),(1,1,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3)$ satisfy the condition, so the answer is .
- For , the combinations satisfy the condition, so the answer is .
4 5
36
36
20
20
20
36
36
6 1000
149393349
149393349
668669001
668669001
4000002
4000002
4000002
668669001
668669001
149393349
149393349