Rohit and his brother Rohan have two old wooden chests, A and B, consisting of N integers. They also got an old rusted trunk with lots of diamonds inside it. However, the rusted trunk has a lock that can only be opened if they know the number of combinations possible such that the following conditions are satisfied.
Assume they choose a set of numbers {S1,S2,S3...SK} consisting of integers from 1 to N. Let Amax denote the maximum element of the numbers, {A[S1],A[S2]...A[SK]} and Bsum denote the sum of the elements {B[S1],B[S2]...B[SK]}. Then, Amax must be greater than or equal to Bsum. Since the answer could be large, compute it modulo 109+7.
Input Format :
Output Format :
For each test case, print an integer denoting the number of subsets or combinations satisfying the conditions given in the statement modulo 109+7.
Constraints :
1≤T≤5
1≤N≤1000
1≤Ai≤1000
1≤Bi≤1000
In the first test case, the answer should be 3 because subsets {1}, {2} and {3} satisfy the above conditions.
In the second test case, the answer should be 0 because no subset or combination satisfies the conditions described in the problem statement.