Codeforces Round 712 (Div. 1)
E
2-Coloring
Codeforces
3100
原题
← DF →
翻译中…

There is a grid with $n$ rows and $m$ columns. Every cell of the grid should be colored either blue or yellow.

翻译中…

A coloring of the grid is called stupid if every row has exactly one segment of blue cells and every column has exactly one segment of yellow cells.

翻译中…

In other words, every row must have at least one blue cell, and all blue cells in a row must be consecutive. Similarly, every column must have at least one yellow cell, and all yellow cells in a column must be consecutive.

翻译中…

image An example of a stupid coloring.

翻译中…

image Examples of clever colorings. The first coloring is missing a blue cell in the second row, and the second coloring has two yellow segments in the second column.

翻译中…

How many stupid colorings of the grid are there? Two colorings are considered different if there is some cell that is colored differently.

翻译中…

Input

翻译中…

The only line contains two integers $n$, $m$ ($1\le n, m\le 2021$).

翻译中…

Output

翻译中…

Output a single integer — the number of stupid colorings modulo $998244353$.

翻译中…

Note

翻译中…

In the first test case, these are the only two stupid $2\times 2$ colorings.

翻译中…

image

翻译中…

样例

Input #1
2 2
Output #1
2
InputCopy OutputCopy
Input #2
4 3
Output #2
294
InputCopy OutputCopy
Input #3
2020 2021
Output #3
50657649
InputCopy OutputCopy
题目信息
题号
1503E
时间限制
3 s
内存限制
256 MB
标签
组合数学
动态规划
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。