#2675. 集训题单

集训题单

Description

小爱老师正在准备本次信息学集训的选题,为此他已经准备了 <math xmlns="http://www.w3.org/1998/Math/MathML">n 道备选试题,每题都有一个难度值,其中第 <math xmlns="http://www.w3.org/1998/Math/MathML">i 道题的难度值为 <math xmlns="http://www.w3.org/1998/Math/MathML">ai 。

由于集训时长的限制,小爱准备从这些备选试题中选出 <math xmlns="http://www.w3.org/1998/Math/MathML">m 道试题组成正式的集训题单。为了保证集训的质量及难度,选出的 <math xmlns="http://www.w3.org/1998/Math/MathML">m 道试题中需保证至少有 <math xmlns="http://www.w3.org/1998/Math/MathML">k 道试题的难度不低于给定的难度值 <math xmlns="http://www.w3.org/1998/Math/MathML">X

请你帮助小爱计算一下,一共有多少种不同的选题方式?由于答案可能很大,请输出最终方案数 <math xmlns="http://www.w3.org/1998/Math/MathML">%998244353 即可。
(注意:选出相同的试题但前后顺序不同,均认为是同一种选法。)

Input Format

输入共三行:
输入第一行,两个正整数 <math xmlns="http://www.w3.org/1998/Math/MathML">n,m
输入第二行,<math xmlns="http://www.w3.org/1998/Math/MathML">n 个正整数,分别表示 <math xmlns="http://www.w3.org/1998/Math/MathML">a1,a2,...,an
输入第三行,两个正整数 <math xmlns="http://www.w3.org/1998/Math/MathML">k,X

Output Format

输出满足条件的方案数对 <math xmlns="http://www.w3.org/1998/Math/MathML">998244353 取模后的结果
3 2
10 20 30
1 20
3

Hint

样例说明1:
可以选{10,20},{10,30},{20,30}共3种选法
样例输入2:
4 2
5 10 15 20
1 12
样例输出2:
5
样例说明2:

可以选{5,15},{5,20},{10,15},{10,20},{15,20}共5种选法


  • 对于<math xmlns="http://www.w3.org/1998/Math/MathML">50%的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1n20
  • 对于<math xmlns="http://www.w3.org/1998/Math/MathML">100%的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1n103 ,<math xmlns="http://www.w3.org/1998/Math/MathML">1kmn ,<math xmlns="http://www.w3.org/1998/Math/MathML">1ai,X109


Source

数论 组合问题 第四届上海市竞赛