What is Helianthuswolf's culture? Helianthuswolf values innovation, passion, quality, collaboration, and diversity. As Helianthuswolf has grown into a giant successful multinational company and has a huge growing number of global offices, now it values diversity the most.
But the recruiters in Helianthuswolf are exaggerated and stereotyped slightly. They need a quantifiable formula to measure diversity. After reading the math book, they think variance is the best measure of diversity. So they want to maximize the variance of the ages of the remaining programmers after the layoff.
There are multiple test cases. The first line of input contains an integer T ,indicating the number of test cases. For each test case:The first line contains two integers n and m (1 ≤ n ≤ 105,0 ≤ m < n),indicating the number of programmers in that team and the number of programmers the company will lay off.The second line contains n integers a1,a2,...,an(0 ≤ ai ≤ 104) , indicating the age of each programmer.It is guaranteed that the sum of n over all the cases is less than 2×106.
For each test case, output n - m integers in one line in increasing order. The n - m ntegers are the indices of the remaining programmers. If there are multiple solutions maximizing the variance, please choose the lexicographically smallest one.DO NOToutput extra spaces at the end of each line.Sequence {x1,x2,...xp} is lexicographically smaller than sequence {y1,y2,...yq},if either p < q and xi = yi for all 1 ≤ i ≤ p, or there exists an integer r(r < p, r < q),such that xi = yi for all 1 ≤ i ≤ r and xr+1 < yr+1.
9 3 2 34 35 36 4 2 20 35 41 74 5 2 40 30 50 20 10 5 2 50 40 30 20 10 5 2 10 20 30 40 50 5 3 30 40 20 10 50 5 4 10 20 30 40 50 5 1 30 50 40 20 10 5 0 30 50 40 20 10
In the first case, laying any two programmers off does not change variance, so we have three candidate answers "1", "2" and "3". Among the three answers, "1" has the smallest lexicographical order. So we output "1" (without quotes).
In the second case, laying a 35-year-old (the 2nd one) and a 41-year-old (the 3rd one) programmer off maximises the variance. As "1 4" is lexicographically smaller than "4 1", we output "1 4" (without quotes).
In the third case, we have 12 candidate answers "1 3 5", "1 5 3", "3 1 5", "3 5 1", "5 1 3", "5 3 1", "3 4 5", "3 5 4", "4 3 5", "4 5 3", "5 3 4" and "5 4 3". As "1 3 5" is the lexicographically smallest one, we output "1 3 5" (without quotes).