Codeforces 8VC Venture Cup 2016 - Elimination Round F. Group Projects 差分DP*****

发布时间:2017-7-1 11:13:41编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"Codeforces 8VC Venture Cup 2016 - Elimination Round F. Group Projects 差分DP***** ",主要涉及到Codeforces 8VC Venture Cup 2016 - Elimination Round F. Group Projects 差分DP***** 方面的内容,对于Codeforces 8VC Venture Cup 2016 - Elimination Round F. Group Projects 差分DP***** 感兴趣的同学可以参考一下。

F. Group Projects
 

There are n students in a class working on group projects. The students will divide into groups (some students may be in groups alone), work on their independent pieces, and then discuss the results together. It takes the i-th student ai minutes to finish his/her independent piece.

If students work at different paces, it can be frustrating for the faster students and stressful for the slower ones. In particular, the imbalance of a group is defined as the maximum ai in the group minus the minimum ai in the group. Note that a group containing a single student has an imbalance of 0. How many ways are there for the students to divide into groups so that the total imbalance of all groups is at most k?

Two divisions are considered distinct if there exists a pair of students who work in the same group in one division but different groups in the other.

Input

The first line contains two space-separated integers n and k (1 ≤ n ≤ 200, 0 ≤ k ≤ 1000) — the number of students and the maximum total imbalance allowed, respectively.

The second line contains n space-separated integers ai (1 ≤ ai ≤ 500) — the time it takes the i-th student to complete his/her independent piece of work.

Output

Print a single integer, the number of ways the students can form groups. As the answer may be large, print its value modulo 109 + 7.

Examples
input
3 2
2 4 5


上一篇:安装部署zookeeper集群
下一篇:转--后台开发人员的技术栈

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

好贷网好贷款