#P5824. 十二重计数法
十二重计数法
Description
There are balls and boxes, and all balls must be put into the boxes. There are also some constraints. How many ways are there to place the balls? (The order of placing does not matter.)
The constraints are as follows:
: All balls are distinct, and all boxes are distinct.
: All balls are distinct, and all boxes are distinct; each box holds at most one ball.
: All balls are distinct, and all boxes are distinct; each box holds at least one ball.
: All balls are distinct, and all boxes are identical.
: All balls are distinct, and all boxes are identical; each box holds at most one ball.
: All balls are distinct, and all boxes are identical; each box holds at least one ball.
: All balls are identical, and all boxes are distinct.
: All balls are identical, and all boxes are distinct; each box holds at most one ball.
: All balls are identical, and all boxes are distinct; each box holds at least one ball.
: All balls are identical, and all boxes are identical.
: All balls are identical, and all boxes are identical; each box holds at most one ball.
: All balls are identical, and all boxes are identical; each box holds at least one ball.
Since the answer may be very large, take it modulo .
Input Format
Only one line with two positive integers .
Output Format
Output twelve lines. Each line contains one integer, corresponding to the answer under each constraint.
13 6
83517427
0
721878522
19628064
0
9321312
8568
0
792
71
0
14
Hint
Constraints
For of the testdata, .
orz 。
Translated by ChatGPT 5
京公网安备 11011102002149号