P4831 Scarlet Loves WenHuaKe

Background

Scarlet has started college. Before that, she worked hard on a Gaokao mock exam problem QAQ.

Description

Scarlet tries to place $2\times n$ cannons on an $n$-row $m$-column Chinese chessboard such that none of them can attack each other. As everyone knows, Scarlet loves making trouble. She wants to ask how many valid configurations there are.

Input Format

One line with two integers, representing $n$ and $m$.

Output Format

One integer, the number of configurations modulo $998244353$.

Explanation/Hint

For $20\%$ of the testdata, $n,m\leq5$. For another $25\%$ of the testdata, $n,m\leq2000$. For another $20\%$ of the testdata, $n=m$. For the remaining $35\%$ of the testdata, $m-n\leq10$. For $100\%$ of the testdata, $1\leq n\leq m\leq100000$. Translated by ChatGPT 5