{"problem":{"name":"Mahjong","description":{"content":"Find the number, modulo $998244353$, of sequences of $N$ non-negative integers $A=(A_1,A_2,\\dots,A_N)$ totaling $M$ that satisfy the following condition. *   It is possible to make all elements of $A","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc160_d"},"statements":[{"statement_type":"Markdown","content":"Find the number, modulo $998244353$, of sequences of $N$ non-negative integers $A=(A_1,A_2,\\dots,A_N)$ totaling $M$ that satisfy the following condition.\n\n*   It is possible to make all elements of $A$ equal $0$ by repeatedly choosing one of the following operations and performing it.\n    *   Choose an integer $i$ such that $1 \\le i \\le N$ and decrease $A_i$ by $K$.\n    *   Choose an integer $i$ such that $1 \\le i \\le N-K+1$ and decrease each of $A_i,A_{i+1},\\dots,A_{i+K-1}$ by $1$.\n\n## Constraints\n\n*   $1 \\le K \\le N \\le 2000$\n*   $1 \\le M \\le 10^{18}$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc160_d","tags":[],"sample_group":[["3 2 2","5\n\nThe following five sequences satisfy the requirements.\n\n*   $(1,1,0)$\n*   $(0,1,1)$\n*   $(2,0,0)$\n*   $(0,2,0)$\n*   $(0,0,2)$\n\nFor instance, if $A=(0,1,1)$, you can do the following to make all elements of $A$ equal $0$.\n\n*   Perform the second operation. Choose $i = 2$ to decrease each of $A_2$ and $A_3$ by $1$, making $A=(0,0,0)$."],["100 998244353 100","0\n\nThere may be no sequence that satisfies the requirements."],["2000 545782618661124208 533","908877889"]],"created_at":"2026-03-03 11:01:14"}}