P10963 [HackerEarth] nikhil and his golden children
普及
题目描述

Mr Nikhil has k Children. They are suffering from a disease called Gasomia .
According to his family Doctor , Child 1 requires atleast x1 tablets , Child 2 requires atleast x2 ......... Child k requires atleast xk tablets.
As Nikhil got job in Golden Ship,he bought m tablets and wants to distribute all the tablets among his children.Can you tell him the number of ways of distributing tablets among children in such a way,that all the children get satisfied.
As the numbers of ways can be very large, print ans mod 1000000007

Input
First line of the input contains T , denoting number of test cases

For each test case it contains two integers k and m denoting— number of children and the number of tablets he have respectively.

Then follow k numbers , denoting minimum tablets needed by child i, 1≤ i ≤ k

Output
Print the number of ways % 1000000007.

SAMPLE INPUT
1
2 3
1 1

SAMPLE OUTPUT
2

Explanation

In the Sample Test Case ,Nikhil has 2 children x1 and x2 and he bought 3 tablets.
x1 needs atleast 1 tablet
x2 needs atleast 1 tablet
so he can distribute in 2 ways i.e (1,2) and (2,1)

输入格式

见题面

输出格式

见题面

样例输入
1 2 3 1 1 SAMPLE
样例输出
2