問題一覧 > 通常問題

No.1414 University of Tokyo Humanities Mathematics 2021 Problem 2 (Modified)

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 39
作問者 : evima / テスター : 37zigen iaNTU
お気に入りにしたユーザー ProblemId : 5926 / 自分の提出
問題文最終更新日: 2021-03-14 11:33:03
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
1時間コンテスト02 (順位表) の他の問題:

Problem Statement

Let $N, M, K$ be given integers. Choose $M$ distinct integers from the integers between $1$ and $N$, inclusive.
Let $S$ be the set of chosen numbers, and consider the following condition on $S$.

 Condition: $S$ contains at least $1$ set consisting of $K$ consecutive integers.

Here, for an integer $k$ at least $2$, a set consisting of $k$ consecutive integers refers to a set that can be written as $\{l, l + 1, \cdots\cdots, l + k - 1\}$ using some integer $l$.
For example, $\{1, 2, 3, 5, 7, 8, 9, 10\}$ contains the sets $\{1, 2, 3\}, \{7, 8, 9\}, \{8, 9, 10\}$, each consisting of $3$ consecutive integers.

How many ways of choosing satisfy the condition? Output this number of ways modulo $998244353$ to the answer file.

Input

$N\ M\ K$

  • $2 \leqq K \leqq M \leqq N \leqq 10^7$
  • $N, M, K$ are integers.

Output

Output the answer, followed by a newline.

Sample

Sample 1
Input
4 2 2
Output
3

The ways of choosing that satisfy the condition are the $3$ ways $\{1, 2\}, \{2, 3\}, \{3, 4\}$.

Sample 2
Input
10 5 3
Output
126

Sample 3
Input
10000000 5000000 2021
Output
107056641

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。