CF1477F.Nezzar and Chocolate Bars
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Nezzar buys his favorite snack — n chocolate bars with lengths l1,l2,…,ln . However, chocolate bars might be too long to store them properly!
In order to solve this problem, Nezzar designs an interesting process to divide them into small pieces. Firstly, Nezzar puts all his chocolate bars into a black box. Then, he will perform the following operation repeatedly until the maximum length over all chocolate bars does not exceed k .
- Nezzar picks a chocolate bar from the box with probability proportional to its length x .
- After step 1 , Nezzar uniformly picks a real number r∈(0,x) and divides the chosen chocolate bar into two chocolate bars with lengths r and x−r .
- Lastly, he puts those two new chocolate bars into the black box.
Nezzar now wonders, what is the expected number of operations he will perform to divide his chocolate bars into small pieces.
It can be shown that the answer can be represented as QP , where P and Q are coprime integers and Q≡0 ( mod998244353 ). Print the value of P⋅Q−1mod998244353 .
输入格式
The first line contains two integers n and k ( 1≤n≤50,1≤k≤2000 ).
The second line contains n integers l1,l2,…,ln ( 1≤li , ∑i=1nli≤2000 ).
输出格式
Print a single integer — the expected number of operations Nezzar will perform to divide his chocolate bars into small pieces modulo 998244353 .
输入输出样例
输入#1
1 1 2
输出#1
4
输入#2
1 1 1
输出#2
0
输入#3
1 5 1234
输出#3
15630811
输入#4
2 1 2 3
输出#4
476014684
输入#5
10 33 10 20 30 40 50 60 70 80 90 100
输出#5
675105648