No.2303 Frog on Grid
タグ : / 解いたユーザー数 75
作問者 :
Problem Statement
There is a frog at the point $(0, 0)$ on a two-dimensional plane. When the frog is at the point $(i, j)$, it can jump and land on any one of the points $(i + 1, j), (i, j + 1), (i + 2, j), (i, j + 2)$.
The frog wants to reach the point $(H, W)$ by repeatedly jumping. Find the number of ways to move, modulo $998244353$.
$2$ ways to move are considered different if the sets of points on which the frog lands during the movement are different.
Constraints
- All input values are integers.
- $1 \leq H, W \leq 2 \times 10^5$
Input
The input is given from standard input in the following format.
$H$ $W$
Output
Print the answer.
Sample
Sample 1
Input
2 3
Output
32
There are $32$ ways for the frog to move in total. For example, the following movements are possible.
- $(0, 0) \rightarrow (0, 1) \rightarrow (0, 2) \rightarrow (2, 2) \rightarrow (2, 3)$
- $(0, 0) \rightarrow (2, 0) \rightarrow (2, 2) \rightarrow (2, 3)$
Sample 2
Input
100 100
Output
853998634
Sample 3
Input
100000 200000
Output
664894518
Find the answer modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。