{"problem":{"name":"Affinity for Artifacts","description":{"content":"Snuke the wizard has $N$ magical lamps numbered $1$ to $N$. The cost of the $i$\\-th lamp is $a_i$. Initially, none of the lamps are lit. Snuke has an integer value called MP, which is initially $X$. W","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc207_a"},"statements":[{"statement_type":"Markdown","content":"Snuke the wizard has $N$ magical lamps numbered $1$ to $N$. The cost of the $i$\\-th lamp is $a_i$. Initially, none of the lamps are lit.\nSnuke has an integer value called MP, which is initially $X$. When Snuke lights a lamp with cost $x$, his MP decreases by $x$. Each time Snuke lights one lamp, the cost of all lamps with cost at least $1$ decreases by $1$.\nThere are $N!$ possible orders to light the lamps. Find the number, modulo $998244353$, of such orders where MP never becomes negative.\n\n## Constraints\n\n*   $1 \\le N \\le 100$\n*   $0 \\le a_i \\le 10^{9}$\n*   $0 \\le X \\le 10^9$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $X$\n$a_1$ $a_2$ $\\dots$ $a_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc207_a","tags":[],"sample_group":[["3 1\n0 1 2","3\n\nWe explain one order where MP never becomes negative.\n\n*   First, light lamp $1$. MP decreases by $0$.\n*   Next, light lamp $3$. MP decreases by $1$.\n*   Finally, light lamp $2$. MP decreases by $0$.\n\nNote that the cost of a lamp never becomes negative."],["6 8\n2 1 4 8 1 4","176"],["20 50\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19","63942667\n\nDo not forget to find the remainder modulo $998244353$."]],"created_at":"2026-03-03 11:01:14"}}