OI Problems   关于

#g5bvi7. The Top Scorer

时间限制:3 s       空间限制:256 MiB       标签: 数学 组合数学 容斥原理 组合计数 概率期望 CodeForces 缺题解 

算法难度等级:4       思维难度等级:4       实现难度等级:3


本题来源于:Educational Codeforces Round 57 (Rated for Div. 2) Problem E

  • English
  • 简体中文

本题可以加强到 r, s, p107r,\ s,\ p\leq 10^7,题解中将介绍该做法。

Hasan loves playing games and has recently discovered a game called TopScore. In this soccer-like game there are pp players doing penalty shoot-outs. Winner is the one who scores the most. In case of ties, one of the top-scorers will be declared as the winner randomly with equal probability.

They have just finished the game and now are waiting for the result. But there's a tiny problem! The judges have lost the paper of scores! Fortunately they have calculated sum of the scores before they get lost and also for some of the players they have remembered a lower bound on how much they scored. However, the information about the bounds is private, so Hasan only got to know his bound.

According to the available data, he knows that his score is at least rr and sum of the scores is ss.

Thus the final state of the game can be represented in form of sequence of pp integers a1,a2,,apa _ 1,a _ 2,\cdots,a _ p ( 0ai0 \le a _ i ) — player's scores. Hasan is player number 11 , so a1ra _ 1 \ge r . Also a _ 1 + a _ 2 + \dots + a _ p = s . Two states are considered different if there exists some position ii such that the value of aia_i differs in these states.

Once again, Hasan doesn't know the exact scores (he doesn't know his exact score as well). So he considers each of the final states to be equally probable to achieve.

Help Hasan find the probability of him winning.

It can be shown that it is in the form of PQ\dfrac{P}{Q} where PP and QQ are non-negative integers and Q0Q \ne 0 , PQP \le Q . Report the value of PQ1 (mod 998244353)P\cdot Q^{-1}\ (\text{mod 998244353}) .

Input

The only line contains three integers pp , ss and rr ( 1p1001 \le p \le 100 , 0rs50000 \le r \le s \le 5000 ) — the number of players, the sum of scores of all players and Hasan's score, respectively.

Output

Print a single integer — the probability of Hasan winning.

It can be shown that it is in the form of PQ\dfrac{P}{Q} where PP and QQ are non-negative integers and Q0Q \ne 0 , PQP \le Q . Report the value of PQ1 (mod 998244353)P\cdot Q^{-1}\ (\text{mod 998244353}) .

Sample

2 6 3
124780545
5 20 11
1
10 30 10
85932500

Note

In the first example Hasan can score 33 , 44 , 55 or 66 goals. If he scores 44 goals or more than he scores strictly more than his only opponent. If he scores 33 then his opponent also scores 33 and Hasan has a probability of 12\dfrac 1 2 to win the game. Thus, overall he has the probability of 78\dfrac 7 8 to win.

In the second example even Hasan's lower bound on goal implies him scoring more than any of his opponents. Thus, the resulting probability is 11 .

本题可以加强到 r, s, p107r,\ s,\ p\leq 10^7,题解中将介绍该做法。

题目描述

对于一个长度为 nn 的非负整数序列 a1,a2,,ana_1, a_2, \cdots , a_n,已知 a1ka_1 \geq ki=1nai=m\sum^n_{i=1} ai = m,询问 a1a_1 是最大值的概率,如果序列中有多个最大值,随机任意一个作为最大值。

输入格式

nmkn\quad m\quad k

输出格式

最大值的概率,对 998244353998244353 取模后输出。

输入输出样例

2 6 3
124780545

数据范围与提示

对于 100%100\% 的数据,n100n\leq 100m,k5000m,k\leq 5000