{"problem":{"name":"Mex on Blackboard","description":{"content":"For a finite multiset $S$ of non-negative integers, let us define $\\mathrm{mex}(S)$ as the smallest non-negative integer not in $S$. For instance, $\\mathrm{mex}(\\lbrace 0,0, 1,3\\rbrace ) = 2, \\mathrm{","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc156_b"},"statements":[{"statement_type":"Markdown","content":"For a finite multiset $S$ of non-negative integers, let us define $\\mathrm{mex}(S)$ as the smallest non-negative integer not in $S$. For instance, $\\mathrm{mex}(\\lbrace 0,0, 1,3\\rbrace ) = 2, \\mathrm{mex}(\\lbrace 1 \\rbrace) = 0, \\mathrm{mex}(\\lbrace \\rbrace) = 0$.\nThere are $N$ non-negative integers on a blackboard. The $i$\\-th integer is $A_i$.\nYou will perform the following operation exactly $K$ times.\n\n*   Choose zero or more integers on the blackboard. Let $S$ be the multiset of chosen integers, and write $\\mathrm{mex}(S)$ on the blackboard once.\n\nHow many multisets can be the multiset of integers on the final blackboard? Find this count modulo $998244353$.\n\n## Constraints\n\n*   $1 \\leq N,K \\leq 2\\times 10^5$\n*   $0\\leq A_i\\leq 2\\times 10^5$\n*   All numbers in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $K$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc156_b","tags":[],"sample_group":[["3 1\n0 1 3","3\n\nThe following three multisets can be obtained by the operations.\n\n*   $\\lbrace 0,0,1,3 \\rbrace$\n*   $\\lbrace 0,1,1,3\\rbrace$\n*   $\\lbrace 0,1,2,3 \\rbrace$\n\nFor instance, you can get $\\lbrace 0,1,1,3\\rbrace$ by choosing the $0$ on the blackboard to let $S=\\lbrace 0\\rbrace$ in the operation."],["2 1\n0 0","2\n\nThe following two multisets can be obtained by the operations.\n\n*   $\\lbrace 0,0,0 \\rbrace$\n*   $\\lbrace 0,0,1\\rbrace$\n\nNote that you may choose zero integers in the operation."],["5 10\n3 1 4 1 5","7109"]],"created_at":"2026-03-03 11:01:14"}}