{"problem":{"name":"Missing Subsequence","description":{"content":"You are given a sequence of integers $(X_1,\\dots,X_M)$ of length $M$ consisting of $1,\\dots,K$. Find the number of sequences $(A_1,\\dots,A_N)$ of length $N$ consisting of $1,\\dots,K$ that satisfy the ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc186_e"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of integers $(X_1,\\dots,X_M)$ of length $M$ consisting of $1,\\dots,K$.\nFind the number of sequences $(A_1,\\dots,A_N)$ of length $N$ consisting of $1,\\dots,K$ that satisfy the following condition, modulo $998244353$:\n\n*   Among all sequences of length $M$ consisting of $1,\\dots,K$, the only sequence that cannot be obtained as a (not necessarily contiguous) subsequence of $(A_1,\\dots,A_N)$ is $(X_1,\\dots,X_M)$.\n\n## Constraints\n\n*   $2\\le M,K \\le N \\le 400$\n*   $1\\le X_i \\le K$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$ $K$\n$X_1$ $X_2$ $\\dots$ $X_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc186_e","tags":[],"sample_group":[["5 2 3\n1 1","4\n\nThe following four sequences satisfy the condition:\n\n*   $(2, 3, 1, 2, 3)$\n*   $(2, 3, 1, 3, 2)$\n*   $(3, 2, 1, 2, 3)$\n*   $(3, 2, 1, 3, 2)$"],["400 3 9\n1 8 6","417833302"],["29 3 10\n3 3 3","495293602"],["29 3 10\n3 3 4","0"]],"created_at":"2026-03-03 11:01:14"}}