Dice Sum

AtCoder
IDabc248_c
Time2000ms
Memory256MB
Difficulty
How many integer sequences of length $N$, $A=(A_1, \ldots, A_N)$, satisfy all of the conditions below? * $1\le A_i \le M$ $(1 \le i \le N)$ * $\displaystyle\sum _{i=1}^N A_i \leq K$ Since the count can get enormous, find it modulo $998244353$. ## Constraints * $1 \leq N, M \leq 50$ * $N \leq K \leq NM$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $M$ $K$ [samples]
Samples
Input #1
2 3 4
Output #1
6

The following six sequences satisfy the conditions.

*   $(1,1)$
*   $(1,2)$
*   $(1,3)$
*   $(2,1)$
*   $(2,2)$
*   $(3,1)$
Input #2
31 41 592
Output #2
798416518

Be sure to print the count modulo $998244353$.
API Response (JSON)
{
  "problem": {
    "name": "Dice Sum",
    "description": {
      "content": "How many integer sequences of length $N$, $A=(A_1, \\ldots, A_N)$, satisfy all of the conditions below? *   $1\\le A_i \\le M$ $(1 \\le i \\le N)$      *   $\\displaystyle\\sum _{i=1}^N A_i \\leq K$      Si",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc248_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "How many integer sequences of length $N$, $A=(A_1, \\ldots, A_N)$, satisfy all of the conditions below?\n\n*   $1\\le A_i \\le M$ $(1 \\le i \\le N)$\n    \n*   $\\displaystyle\\sum _{i=1}^N A_i \\leq K$\n    \n\nSi...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments