Cutting a Hypertriangle
Time limit1sMemory limit1024 MB
Counts the ways to pick cut pieces of an M-dimensional hypertriangle of edge N that form a solid hypertriangle block, modulo 1e9+7.
- Level
Medium6 of 10
- Topics
- Combinatorics, Math, Geometry
- Solved
- No attempts yet
Problem
An -dimensional hypertriangle is a regular -dimensional polytope with vertices. For it is an equilateral triangle, and for it is a regular tetrahedron.
A block shaped like an -dimensional hypertriangle with edge length is given. Cut the block parallel to each -dimensional face so that every edge is divided into equal parts. Then select some of the pieces and combine them into an -dimensional hypertriangle block without moving or rotating them from their original positions. The original block is solid, and the new block must also have no empty space inside. Write a program that counts the number of ways to form an -dimensional hypertriangle block.
Input
Two integers and are given, separated by a space.
Output
Print the number of ways to form an -dimensional hypertriangle block. Since the number can be very large, print the remainder when divided by . Note that is prime.
Hint
In this problem, two -dimensional figures and in -dimensional Euclidean space are called parallel when the following holds. Set an infinite -dimensional space that contains and an infinite -dimensional space that contains . Every point of has the same distance to its orthogonal projection onto , and that distance is not 0.