No.1186 Rectangle Tiling
タグ : / 解いたユーザー数 208
作問者 :
kaage
Problem Statement
You have an unlimited number of rectangular pieces of height $1$ and width $N$.
NatsubiSogan, who loves tiling rectangles, has given you the following order!
- Use those pieces to tile a rectangle of height $N$ and width $M$ with no gaps.
Here, "tile" means to reach a state where every region of the rectangle is covered by exactly $1$ piece, without breaking pieces, overlapping pieces, or letting pieces extend outside the rectangle. For example, you cannot tile by placing pieces diagonally.
Unfortunately, you are very bad at puzzles. So you have decided to use a computer to find out how many such tilings there are.
Output this answer modulo $998244353$.
Note that the pieces of height $1$ and width $N$ may be rotated freely, and tilings that become identical by rotating or reflecting the whole rectangle are counted as distinct.
Input
$N\ M$
- All inputs are integers.
- $1 \leq N \leq 10^9$
- $1 \leq M \leq 10^6$
Output
Output the answer modulo $998244353$ on one line.
Print a newline at the end.
Sample
Sample 1
Input
2 4
Output
5
As shown in the image, there are $5$ possible arrangements.
Sample 2
Input
3 4
Output
3
As shown in the image, there are $3$ possible arrangements.
Sample 3
Input
1000000000 1000000
Output
1
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。