No Max No Min
You have an array with n elements. you have to create all subsequences of this array with length K. For each subsequence, you have to write down the product of k-2 integers, all elements of this sequence except the minimum and maximum element.Input Format
your work will be considered done if you will be able to write down all these numbers and tell PepBoss their product mod 10^9+7.
The first line contains integer N (length of array) and K.Output Format
The second line contains N space separated integers.
Print a single line containing one integer - the product of all numbers written down by you modulo 10^9+7.Question Video
1<= N <= 5000Sample Input
3 <= K <= N
1 <= arr[i] <= 10000
4 3Sample Output
1 2 3 4
36
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run