Sequence

AtCoder
IDfps_24_c
Time2000ms
Memory256MB
Difficulty
Among integer sequences of length $N$ consisting of non-negative integers not greater than $M$, find the number of sequences whose total sum is exactly $S$. Output the result modulo $998244353$. ## Constraints * $1 \leq N \leq 2 \times 10^5$ * $1 \leq M \leq 2 \times 10^5$ * $1 \leq S \leq 2 \times 10^5$ * $N, M, S$ are integers ## Input The input is given from standard input in the following format: $N$ $M$ $S$ [samples]
Samples
Input #1
3 2 4
Output #1
6

There are $6$ sequences that satisfy the condition:

*   $(0,2,2)$
*   $(1,1,2)$
*   $(1,2,1)$
*   $(2,0,2)$
*   $(2,1,1)$
*   $(2,2,0)$
Input #2
12345 678 90123
Output #2
226012779
API Response (JSON)
{
  "problem": {
    "name": "Sequence",
    "description": {
      "content": "Among integer sequences of length $N$ consisting of non-negative integers not greater than $M$, find the number of sequences whose total sum is exactly $S$.   Output the result modulo $998244353$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "fps_24_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Among integer sequences of length $N$ consisting of non-negative integers not greater than $M$, find the number of sequences whose total sum is exactly $S$.  \nOutput the result modulo $998244353$.\n\n##...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments