


N = 4 , K = 3
A = [ 1, 2, 3, 4 ]
Explanation :
All subsequence of size ‘3’ are :
[ 1, 2, 3 ] : The product is 2.
[ 1, 2, 4 ] : The product is 2.
[ 1, 3, 4 ] : The product is 3.
[ 2, 3, 4 ] : The product is 3.
The final product is 2*2*3*3 = 36.
The first line contains an integer 'T' which denotes the number of test cases to be run. Then the test cases follow.
The first line of each test case contains integers ‘N’ and ‘K’.
The next line contains ‘N’ integers representing the elements of array ‘A’.
For each test case, output an integer denoting the required product modulo 10^9+7.
Print the output of each test case in a new line.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
3 <= N <= 5000
3 <= K <= N
1 <= A[i] <= 10^5
Time Limit : 1 sec
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers