{"problem":{"name":"Limestone","description":{"content":"You are given positive integers $H,W$. There is an $H \\times W$ matrix $A=(A_{i,j})\\ (1\\leq i\\leq H,1\\leq j\\leq W)$, where initially all elements are $0$. You can perform the following two types of op","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc199_d"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $H,W$.\nThere is an $H \\times W$ matrix $A=(A_{i,j})\\ (1\\leq i\\leq H,1\\leq j\\leq W)$, where initially all elements are $0$.\nYou can perform the following two types of operations on this matrix in any order and any number of times:\n\n*   Choose integers $r,c\\ (1\\leq r\\leq H,1\\leq c\\leq W)$. Set all of $A_{r,1},A_{r,2},\\ldots,A_{r,c}$ to $1$.\n*   Choose integers $r,c\\ (1\\leq r\\leq H,1\\leq c\\leq W)$. Set all of $A_{1,c},A_{2,c},\\ldots,A_{r,c}$ to $1$.\n\nFind the sum of $\\displaystyle \\sum_{i=1}^H\\sum_{j=1}^W A_{i,j}$ over all matrices that can be obtained by repeating the above operations, modulo $998244353$.\n\n## Constraints\n\n*   $1\\leq H,W$\n*   $HW\\leq 2\\times 10^5$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$H$ $W$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc199_d","tags":[],"sample_group":[["2 2","29\n\nThere are $14$ matrices that can be obtained by repeating the operations:\n\n$\\begin{pmatrix}0&0 \\\\ 0&0\\end{pmatrix} \\begin{pmatrix}1&0 \\\\ 0&0\\end{pmatrix} \\begin{pmatrix}0&1 \\\\ 0&0\\end{pmatrix} \\begin{pmatrix}1&1 \\\\ 0&0\\end{pmatrix} \\begin{pmatrix}0&0 \\\\ 1&0\\end{pmatrix} \\begin{pmatrix}1&0 \\\\ 1&0\\end{pmatrix} \\begin{pmatrix}0&1 \\\\ 1&0\\end{pmatrix} \\begin{pmatrix}1&1 \\\\ 1&0\\end{pmatrix} \\begin{pmatrix}0&1 \\\\ 0&1\\end{pmatrix} \\begin{pmatrix}1&1 \\\\ 0&1\\end{pmatrix} \\begin{pmatrix}0&0 \\\\ 1&1\\end{pmatrix} \\begin{pmatrix}1&0 \\\\ 1&1\\end{pmatrix} \\begin{pmatrix}0&1 \\\\ 1&1\\end{pmatrix} \\begin{pmatrix}1&1 \\\\ 1&1\\end{pmatrix}$\n\nThe answer is $0+1+1+2+1+2+2+3+2+3+2+3+3+4=29$.\n$\\begin{pmatrix}0&0 \\\\ 0&1\\end{pmatrix}$ and $\\begin{pmatrix}1&0 \\\\ 0&1\\end{pmatrix} $ cannot be obtained by any sequence of operations."],["1 10","5120"],["123 456","428623282"]],"created_at":"2026-03-03 11:01:13"}}