AtCoder Regular Contest 197 (Div. 2)
E
Four Square Tiles
AtCoder
⌀ 2647
原题
← D→
翻译中…

Problem Statement

翻译中…

You are given positive integers $N$, $H$, and $W$, with $H,W \le 3N-1$.

翻译中…

Find the number, modulo $998244353$, of ways to place four $N\times N$ square tiles on an $H\times W$ grid that satisfy all of the following conditions.

翻译中…
  • Each tile exactly covers $N^2$ cells of the grid.
  • No cell is covered by more than one tile.
翻译中…

Here, the tiles are indistinguishable.

翻译中…

There are $T$ test cases; solve each one.

翻译中…

Constraints

翻译中…
  • $1\le T\le 2\times 10^5$
  • $1\le N,H,W\le 10^9$
  • $H,W\le 3N-1$
  • All input values are integers.
翻译中…

Input

翻译中…

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

翻译中…

T
\text{case}_1
\vdots
\text{case}_T

翻译中…

Each case is given in the following format:

翻译中…

N H W

翻译中…

Output

翻译中…

Print $T$ lines. The $i$-th line should contain the number, modulo $998244353$, of valid ways to place the tiles for the $i$-th test case.

翻译中…

样例

Input #1
4
2 4 5
2 5 5
1000 1000 1000
1000 2222 2025
Output #1
9
79
0
262210557
For the first test case, there are $9$ ways as illustrated in the following figure: ![image](https://img.atcoder.jp/arc197/240d39425cb3786e6c8a2952f2220f14.png)
题目信息
题号
arc197_e
时间限制
2 s
内存限制
1024 MB

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