{"problem":{"name":"Sets Scores","description":{"content":"Consider a sequence of integer sets of length $N$: $S=(S_1,S_2,\\dots,S_N)$. We call a sequence **brilliant** if it satisfies all of the following conditions: *   $S_i$ is a (possibly empty) integer s","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc147_d"},"statements":[{"statement_type":"Markdown","content":"Consider a sequence of integer sets of length $N$: $S=(S_1,S_2,\\dots,S_N)$. We call a sequence **brilliant** if it satisfies all of the following conditions:\n\n*   $S_i$ is a (possibly empty) integer set, and its elements are in the range $[1,M]$. $(1 \\le i \\le N)$\n    \n*   The number of integers that is included in exactly one of $S_i$ and $S_{i+1}$ is $1$. $(1 \\le i \\le N-1)$\n    \n\nWe define the score of a brilliant sequence $S$ as $\\displaystyle \\prod_{i=1}^{M}$ $($ the number of sets among $S_1,S_2,\\dots,S_N$ that include $i$.$)$.\nFind, modulo $998244353$, the sum of the scores of all possible brilliant sequences.\n\n## Constraints\n\n*   $1 \\le N,M \\le 2 \\times 10^5$\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]","is_translate":false,"language":"English"}],"meta":{"iden":"arc147_d","tags":[],"sample_group":[["2 3","24\n\nAmong all possible brilliant sequences, the following $6$ have positive scores.\n\n*   $S_1={1,2},S_2={1,2,3}$\n*   $S_1={1,3},S_2={1,2,3}$\n*   $S_1={2,3},S_2={1,2,3}$\n*   $S_1={1,2,3},S_2={1,2}$\n*   $S_1={1,2,3},S_2={1,3}$\n*   $S_1={1,2,3},S_2={2,3}$\n\nAll of them have a score of $4$, so the sum of them is $24$."],["12 34","786334067"]],"created_at":"2026-03-03 11:01:13"}}