#P1999. 高维正方体
高维正方体
Description
Elements in -dimensional space are points, which is beyond doubt.
- elements of -dimensional space can form a -dimensional element, a line segment.
- elements of -dimensional space can form a -dimensional element, a square.
- elements of -dimensional space can form a -dimensional element, a cube.
- elements of -dimensional space can form a -dimensional element, a hypercube.
…
- In a square, there are points (vertices), line segments (edges), and square.
- In a cube, there are points (vertices), line segments (edges), squares (faces), and cube.
…
Our problem is: given and , find how many -dimensional elements are contained in an -dimensional element. The answer may be large; output it modulo .
Input Format
Two integers , separated by a space.
Output Format
One integer, the answer.
3 1
12
Hint
Sample Explanation
The -dimensional element is a cube, and the -dimensional element is a line segment. What is required is the number of edges in a cube, which is .
Constraints
- For of the data, .
- For of the data, .
- For of the data, .
- For of the data, .
- For of the data, .
- For of the data, .
In addition, for of the testdata, ; for each, or .
Tip
It is not guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号