{"raw_statement":[{"iden":"problem statement","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."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 500$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"2"},{"iden":"sample output 1","content":"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."},{"iden":"sample input 2","content":"5"},{"iden":"sample output 2","content":"704332752"},{"iden":"sample input 3","content":"100"},{"iden":"sample output 3","content":"927703658"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}