問題一覧 > 通常問題

No.3538 Not First Place

レベル : / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 32
作問者 : nauclhlt / テスター : もの
お気に入りにしたユーザー ProblemId : 13012 / 自分の提出
問題文最終更新日: 2026-04-28 22:56:42
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
yukicoder contest 499 (順位表) の他の問題:

Note

This problem has been confirmed to be solvable (AC) in C++ and Python, but some optimization may be required depending on the language or runtime.

Problem Statement

A popularity vote was held among $N$ candidates, numbered candidate $1, 2, \cdots, N$.

A total of $M$ people voted in this vote, and each person chose exactly $K$ candidates out of the $N$ candidates and voted for them.

For each $i\ (1\leq i\leq N)$, let $V_i$ be the number of votes received by candidate $i$, and define the sequence $V=(V_1, V_2, \cdots, V_N)$. How many possible sequences $V$ satisfy the following condition?

  • Letting $\displaystyle V_{max}=\max_{1\leq i\leq N} V_i$, we have $V_{max}>V_1\geq L$.

Since the answer can be very large, find it modulo $998244353$.

Input

$N\ M\ K\ L$
  • $2\leq N\leq 3000$
  • $1\leq M\leq 3000$
  • $1\leq K\leq N$
  • $1\leq L\leq M$
  • All inputs are integers.

Output

Let $m$ be the number of possible sequences $V$ satisfying the condition, modulo $998244353$. Print this $m$ on one line.

Print a newline at the end.

Sample

Sample 1
Input
5 3 1 1
Output
4

The $4$ sequences $V$ satisfying the condition are $(1, 2, 0, 0, 0), (1, 0, 2, 0, 0), (1, 0, 0, 2, 0), (1, 0, 0, 0, 2)$.

Sample 2
Input
3000 3000 1500 1500
Output
743177420

Note that you must find the answer modulo $998244353$.

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