問題一覧 > 通常問題

No.2303 Frog on Grid

レベル : / AI推定難易度 : 1925 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 75
作問者 : Shirotsume / テスター : ygussany kaichou243
お気に入りにしたユーザー ProblemId : 9468 / 自分の提出
問題文最終更新日: 2023-05-03 01:28:13
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 388 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。