Given an array of N positive integers. You need to write a program to print the minimum product of k integers of the given array.
Input : 198 76 544 123 154 675 k = 2 Output : 9348 We get minimum product after multiplying 76 and 123. Input : 11 8 5 7 5 100 k = 4 Output : 1400
Note: Since output could be large, hence module 10^9+7 and then print answer.
First line of the input contains an integer T, denoting the number of test cases. Then T test case follows. First line of each test case contains an integer N, denoting the size of the array. Next line contains N space separated integers denoting the elements of the array. Last line of each test case contains the integer K.
For each test case print the required anwer in a new line.
1 2 3 4 5
9 10 8
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.