{"problem":{"name":"Sequence 3","description":{"content":"Consider integer sequences $A = (a_1,a_2,\\dots,a_N)$ of length $N$, where each element is a positive integer not greater than $M$.   Count how many such sequences satisfy the following condition, and ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"fps_24_e"},"statements":[{"statement_type":"Markdown","content":"Consider integer sequences $A = (a_1,a_2,\\dots,a_N)$ of length $N$, where each element is a positive integer not greater than $M$.  \nCount how many such sequences satisfy the following condition, and output the result modulo $998244353$.\n\n*   For every integer $m$ such that $1 \\leq m \\leq M$, the number of times $m$ appears in $A$ is at most $m$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 300$\n*   $1 \\leq M \\leq 300$\n*   $N, M$ are integers\n\n## Input\n\nThe input is given from standard input in the following format:\n\n$N$ $M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"fps_24_e","tags":[],"sample_group":[["2 3","8\n\nThere are $8$ sequences that satisfy the condition:\n\n*   $(1, 2)$\n*   $(1, 3)$\n*   $(2, 1)$\n*   $(2, 2)$\n*   $(2, 3)$\n*   $(3, 1)$\n*   $(3, 2)$\n*   $(3, 3)$"],["300 300","478329414"]],"created_at":"2026-03-03 11:01:14"}}