Company: Sirion_lab
Difficulty: medium
Minimum Subsequence Transfer Time Problem Description You are given an array Arr of N positive integers and an integer M . You must send a subsequence of exactly M elements to the client. A subsequence keeps the original left-to-right order but may skip elements, so it does not have to be contiguous. The time taken to transfer a subsequence is the product of its first and its last element . Among all subsequences of exactly M elements, report the smallest possible transfer time. Function Description Complete the function solve : int N : the number of elements. int M : the required length of the subsequence. long Arr[N] : the array. Returns the minimum product of the first and last elements over all subsequences of length exactly M . Input Format The first line contains the integer T , the number of test cases. For each test case: - a line with two integers N and M ; - a line with N space-separated integers, Arr[0] ... Arr[N-1] . Output Format For each test case print the minimum transf