题库练习 2-Coloring
← 上一题 下一题 →

A14250 | 2-Coloring

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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.

![](/uploads/luogu/CF1503E/f3562aaf6fab4721f0bb458f1d8dd50d6d917a2d_0cbc64c277be.png) An example of a stupid coloring. ![](/uploads/acgo/image/8edf803e3f4413f7_c86bccecc901.jpeg) 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.

输入格式

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

输出格式

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

输入输出样例

输入 #1
2 2
输出 #1
2
输入 #2
4 3
输出 #2
294
输入 #3
2020 2021
输出 #3
50657649
C++ 编辑器
输入
输出