QOJ.ac

QOJ

Time Limit: 15 s Memory Limit: 2048 MB Total points: 100

#10156. Bánh Bò

Statistics

自从地球毁灭以来,Trillian 一直很怀念地球上的美食。今天,她让飞船的食物合成机为她制作了一道她曾经很喜欢的越南美食:bánh bò hấp(蒸发糕)。

Trillian 有无限多的 bánh bò hấp。每一块 bánh bò hấp 要么是红色的,要么是白色的。她想将 $rc$ 块 bánh bò hấp 拼成一个 $r \times c$ 的网格,其中每个单元格包含一块 bánh bò hấp。因此,将 bánh bò hấp 拼成 $r \times c$ 网格的方法共有 $2^{rc}$ 种,因为我们认为相同颜色的块是完全相同的。

如果一个 bánh bò hấp 的组合中,所有的 $6 \times 7$ 子网格都包含相同数量的红色块,我们就称该组合是均匀的。因此,在一个均匀的 bánh bò hấp 组合中,所有的 $6 \times 7$ 子网格也必然包含相同数量的白色块。注意,一个 $r \times c$ 的网格共有 $(r - 5)(c - 6)$ 个 $6 \times 7$ 的子网格。

例如,图 D.1 展示了一个 $7 \times 8$ 的均匀 bánh bò hấp 组合,其中阴影单元格代表红色 bánh bò hấp,未阴影单元格代表白色 bánh bò hấp。图 D.2 显示了所有四个 $6 \times 7$ 子网格都包含 6 个红色块和 36 个白色块。

图 D.1:一个均匀 bánh bò hấp 组合的示例。

图 D.2:图 D.1 中均匀 bánh bò hấp 组合的所有四个 6 × 7 子网格。

给定 $r$ 和 $c$,其中 $r$ 是 6 的倍数,$c$ 是 7 的倍数,Trillian 想计算可能的均匀 bánh bò hấp 组合的数量,结果对 998 244 353 取模。

输入格式

输入包含一行,包含两个整数 $r$ 和 $c$ ($6 \le r \le 66\,666$; $r$ 是 6 的倍数; $7 \le c \le 77\,777$; $c$ 是 7 的倍数)。

输出格式

输出可能的均匀 bánh bò hấp 组合的数量,对 998 244 353 取模。

样例

输入 1

6 7

输出 1

780136139

说明 1

输出结果为 $2^{42}$ 对 998 244 353 取模的值。

输入 2

12 14

输出 2

22889737

输入 3

12 42

输出 3

96403614

输入 4

42 14

输出 4

94940316

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.