P5824 Twelvefold Counting Method

Background

Combinatorics is an old and fascinating subject. Legend has it that as early as $114514$ years ago, a deity named Yi Ai came to Earth and discovered humans—another intelligent species. She found this very interesting. In order to speed up the development of human civilization, she passed down to the human world a type of counting problem—the twelvefold counting. This was also the beginning of combinatorics. Only by figuring out this type of problem can one continue to go deeper in combinatorics.

Description

There are $n$ balls and $m$ 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: $\text{I}$: All balls are distinct, and all boxes are distinct. $\text{II}$: All balls are distinct, and all boxes are distinct; each box holds at most one ball. $\text{III}$: All balls are distinct, and all boxes are distinct; each box holds at least one ball. $\text{IV}$: All balls are distinct, and all boxes are identical. $\text{V}$: All balls are distinct, and all boxes are identical; each box holds at most one ball. $\text{VI}$: All balls are distinct, and all boxes are identical; each box holds at least one ball. $\text{VII}$: All balls are identical, and all boxes are distinct. $\text{VIII}$: All balls are identical, and all boxes are distinct; each box holds at most one ball. $\text{IX}$: All balls are identical, and all boxes are distinct; each box holds at least one ball. $\text{X}$: All balls are identical, and all boxes are identical. $\text{XI}$: All balls are identical, and all boxes are identical; each box holds at most one ball. $\text{XII}$: 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 $998244353$.

Input Format

Only one line with two positive integers $n,m$.

Output Format

Output twelve lines. Each line contains one integer, corresponding to the answer under each constraint.

Explanation/Hint

Constraints For $100\%$ of the testdata, $1\le n,m \le 2\times 10^5$. orz $\mathsf E \color{red}\mathsf{ntropyIncreaser}$。 Translated by ChatGPT 5