{"problem":{"name":"|LIS| = 3","description":{"content":"Find the number of sequences that satisfy all of the conditions below, modulo $998244353$. *   The length is $N$. *   Each of the elements is an integer between $1$ and $M$ (inclusive). *   Its longe","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc237_f"},"statements":[{"statement_type":"Markdown","content":"Find the number of sequences that satisfy all of the conditions below, modulo $998244353$.\n\n*   The length is $N$.\n*   Each of the elements is an integer between $1$ and $M$ (inclusive).\n*   Its longest increasing subsequence has the length of exactly $3$.\n\n## Constraints\n\n*   $3 \\leq N \\leq 1000$\n*   $3 \\leq M \\leq 10$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n\n[samples]\n\n## Notes\n\nA **subsequence** of a sequence is the result of removing zero or more elements from it and concatenating the remaining elements without changing the order. For example, $(10,30)$ is a subsequence of $(10,20,30)$, while $(20,10)$ is not a subsequence of $(10,20,30)$.\nA **longest increasing subsequence** of a sequence is its **strictly** increasing subsequence with the greatest length.","is_translate":false,"language":"English"}],"meta":{"iden":"abc237_f","tags":[],"sample_group":[["4 5","135\n\nOne sequence that satisfies the conditions is $(3,4,1,5)$.  \nOn the other hand, $(4,4,1,5)$ do not, because its longest increasing subsequence has the length of $2$."],["3 4","4"],["111 3","144980434\n\nFind the count modulo $998244353$."]],"created_at":"2026-03-03 11:01:13"}}