{"problem":{"name":"Four Square Tiles","description":{"content":"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 t","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc197_e"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $N$, $H$, and $W$, with $H,W \\le 3N-1$.\nFind 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.\n\n*   Each tile exactly covers $N^2$ cells of the grid.\n*   No cell is covered by more than one tile.\n\nHere, the tiles are indistinguishable.\nThere are $T$ test cases; solve each one.\n\n## Constraints\n\n*   $1\\le T\\le 2\\times 10^5$\n*   $1\\le N,H,W\\le 10^9$\n*   $H,W\\le 3N-1$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\vdots$\n$\\text{case}_T$\n\nEach case is given in the following format:\n\n$N$ $H$ $W$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc197_e","tags":[],"sample_group":[["4\n2 4 5\n2 5 5\n1000 1000 1000\n1000 2222 2025","9\n79\n0\n262210557\n\nFor the first test case, there are $9$ ways as illustrated in the following figure:\n![image](https://img.atcoder.jp/arc197/240d39425cb3786e6c8a2952f2220f14.png)"]],"created_at":"2026-03-03 11:01:13"}}