{"problem":{"name":"Counting Grids","description":{"content":"Find the number of ways, modulo $998244353$, to fill the squares of an $N \\times N$ grid using each integer from $1$ to $N^2$ once so that every square satisfies at least one of the following conditio","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc143_b"},"statements":[{"statement_type":"Markdown","content":"Find the number of ways, modulo $998244353$, to fill the squares of an $N \\times N$ grid using each integer from $1$ to $N^2$ once so that every square satisfies at least one of the following conditions.\n\n*   In the same column, there is a square containing a number greater than that of the concerned square.\n*   In the same row, there is a square containing a number less than that of the concerned square.\n\n## Constraints\n\n*   $1 \\leq N \\leq 500$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc143_b","tags":[],"sample_group":[["2","8\n\nHere is one way to fill the grid to satisfy the requirement.\n\n13\n42\n\nHere, the top-left square contains a number less than that of the bottom-left square, satisfying the first condition. It does not satisfy the second condition, however."],["5","704332752"],["100","927703658"]],"created_at":"2026-03-03 11:01:14"}}