問題一覧 > 通常問題

No.3190 Scoring

レベル : / AI推定難易度 : 2700 / 実行時間制限 : 1ケース 10.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 13
作問者 : 蜜蜂 / テスター : Mitarushi
お気に入りにしたユーザー ProblemId : 12090 / 自分の提出
問題文最終更新日: 2025-06-21 18:45:04
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 471 (順位表) の他の問題:

Problem Statement

It has been decided that the point allocation of the final exam will be determined by taking the median of the teachers' proposals.

Let $A$ be the set of all non-negative integer sequences of length $N$ whose sum is $S$. It can be shown that $A$ is a finite set.
$M$ non-negative integer sequences $V_1, V_2, \cdots, V_M$ of length $N$ are determined by choosing each of them uniformly at random from $A$. Here, each sequence is determined independently.

Also, define a non-negative integer sequence $W = (W_1, W_2, \cdots, W_N)$ of length $N$ so that $W_i$ is the median of the sequence $( V_{1,i}, V_{2,i}, \cdots, V_{M,i})$. Here, $V_{j,i}$ is the $i$-th element of $V_j$. For a sequence of length $M$, its median is defined as the value that is $\lfloor \frac{M + 1}{2} \rfloor$-th when the sequence is sorted in descending order.
Find the expected value of $W_1 + W_2 + \cdots + W_N$ modulo $\mathrm{mod} \ 998244353$.

Here, only inputs for which the answer can be defined modulo $\mathrm{mod} \ P$ for the given $N, S, M$ and the prime $P = 998244353$ are given.
Strictly speaking, for the given $N, S, M$, it is guaranteed that the expected value of $W_1 + W_2 + \cdots + W_N$ is always a rational number and can be represented as $\frac{x}{y}$ using coprime non-negative integers $x, y$. It is also guaranteed that $y \not\equiv 0 \ (\mathrm{mod} \ P)$. In this case, a non-negative integer $z$ such that $yz \equiv x \ (\mathrm{mod} \ P), 0 \leq z < P$ is uniquely determined, so output this $z$.

Input

$N\ \ S\ \ M$

  • $1 \leq N \leq 2 \times 10^5$
  • $1 \leq S \leq 2 \times 10^5$
  • $1 \leq M \leq 2 \times 10^5$
  • All inputs are integers.
  • The answer can be defined modulo $\mathrm{mod} \ 998244353$.

Output

Output the expected value of $W_1 + W_2 + \cdots + W_N$ modulo $\mathrm{mod} \ 998244353$, followed by a newline.

Sample

Sample 1
Input
2 1 3
Output
1

$A = \{ (0, 1), (1, 0) \}$. For example, when $V_1 = (0, 1), V_2 = (1, 0), V_3 = (1, 0)$, we have $W = (1, 0)$.

Sample 2
Input
1 2 3
Output
2

$A = \{ (2) \}$. For example, when $V_1 = (2), V_2 = (2), V_3 = (2)$, we have $W = (2)$.

Sample 3
Input
4 1 2
Output
249561090

The expected value of $W_1 + W_2 + \cdots + W_N$ is $\frac{7}{4}$.

Sample 4
Input
31415 92653 58979
Output
221565867

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