


A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
You need to print your answer modulo 10^9 + 7.
Let us take A = [1,2,3] and P = 4.
All the subsequences not having product more than ‘4’ are {1}, {2}, {3}, {1,2}, {1,3}. Therefore count is equal to ‘5’.
The first line contains a single integer ‘T’ denoting the number of test cases.
The first line of each test case contains two integers, ‘N’-number of elements in the array and ‘P’.
The second line of each test case contains ‘N’ space-separated integers that make up ‘A’.
For each test case, Print an integer denoting the count of subsequences not having a product more than ‘P’.
Print the output of each test case in a separate line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= N <= 10^3
1 <= A[i] <= 10^3
1 <= P <= 10^3
Where A[i] is array element at index ‘i’, ‘P’ is product value.
The Sum of 'N' over all test cases is <= 10 ^ 3.
Time Limit: 1 sec
Base Case:
In the recursive approach, some subproblems are solved again and again.
Let us see the recursion tree for ‘A’ = [1,2,3] and ‘P’ = 4.
It is clear from the recursion tree that the function for (4, 2, 2) is called two times. So to solve this problem of overlapping subproblems, we will use Dynamic programming.
Algorithm: