AtCoder Regular Contest 162
F
Montage
AtCoder
⌀ 3190
原题
← E→
翻译中…

Problem Statement

翻译中…

You are given positive integers $N$ and $M$. Among the $2^{NM}$ matrices $A$ with $N$ rows and $M$ columns where each element is $0$ or $1$, find the number, modulo $998244353$, of ones that satisfy the following condition:

翻译中…
  • $A_{a, b} \times A_{c, d} \leq A_{a, d} \times A_{c, b}$ for every quadruple of integers $(a, b, c, d)$ such that $1 \leq a < c \leq N$ and $1 \leq b < d \leq M$.
翻译中…

Constraints

翻译中…
  • $1 \leq N, M \leq 400$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Print the answer in a single line.

翻译中…

样例

Input #1
2 2
Output #1
13
The condition is $A_{1,1} \times A_{2,2} \leq A_{1,2} \times A_{2,1}$. All $13$ matrices other than $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}$ satisfy the condition.
Input #2
1 30
Output #2
75497471
All $2^{NM}$ matrices satisfy the condition, so print $2^{30}$ modulo $998244353$, that is, $75497471$.
Input #3
400 400
Output #3
412670892
题目信息
题号
arc162_f
时间限制
3 s
内存限制
1024 MB

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