You are given an array a of n integers, and another integer k such that 2k ≤ n.

You have to perform exactly k operations with this array. In one operation, you have to choose two elements of the array (let them be a_i and a_j; they can be equal or different, but their positions in the array must not be the same), remove them from the array, and add ⌊ (a_i)/(a_j) ⌋ to your score, where ⌊ x/y ⌋ is the maximum integer not exceeding x/y.

Initially, your score is 0. After you perform exactly k operations, you add all the remaining elements of the array to the score.

Calculate the minimum possible score you can get.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 500) — the number of test cases.

Each test case consists of two lines. The first line contains two integers n and k (1 ≤ n ≤ 100; 0 ≤ k ≤ ⌊ n/2 ⌋).

The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 2 ⋅ 10^5).

Output

Print one integer — the minimum possible score you can get.

Example

Input


5
7 3
1 1 1 2 1 3 1
5 1
5 5 5 5 5
4 2
1 3 3 7
2 0
4 2
9 2
1 10 10 1 10 2 7 10 3


Output


2
16
0
6
16

Note

Let's consider the example test.

In the first test case, one way to obtain a score of 2 is the following one:

  1. choose a_7 = 1 and a_4 = 2 for the operation; the score becomes 0 + ⌊ 1/2 ⌋ = 0, the array becomes [1, 1, 1, 1, 3]; 
  2. choose a_1 = 1 and a_5 = 3 for the operation; the score becomes 0 + ⌊ 1/3 ⌋ = 0, the array becomes [1, 1, 1]; 
  3. choose a_1 = 1 and a_2 = 1 for the operation; the score becomes 0 + ⌊ 1/1 ⌋ = 1, the array becomes [1]; 
  4. add the remaining element 1 to the score, so the resulting score is 2. 



In the second test case, no matter which operations you choose, the resulting score is 16.

In the third test case, one way to obtain a score of 0 is the following one:

  1. choose a_1 = 1 and a_2 = 3 for the operation; the score becomes 0 + ⌊ 1/3 ⌋ = 0, the array becomes [3, 7]; 
  2. choose a_1 = 3 and a_2 = 7 for the operation; the score becomes 0 + ⌊ 3/7 ⌋ = 0, the array becomes empty; 
  3. the array is empty, so the score doesn't change anymore. 



In the fourth test case, no operations can be performed, so the score is the sum of the elements of the array: 4 + 2 = 6.
1
6 3
4 4 5 5 6 6
 1
6 3
1 1 1 1 2 2
 1
9 3
1 1 1 2 2 2 3 3 3
 1
10 5
3 3 3 4 4 4 5 5 5 1
 1
10 4
1 1 1 2 3 3 3 3 4 5
 1
77 9
9 8 10 5 8 20 17 19 14 16 7 6 15 16 6 13 10 13 14 12 5 6 12 14 12 8 13 12 17 8 12 17 2 11 8 18 17 2 13 2 1 19 9 8 10 20 8 12 15 1 3 15 6 19 4 11 12 8 3 2 1 20 15 14 6 10 11 1 5 11 10 6 20 6 14 16 6
 1
14 7
1 1 1 1 1 1 1 2 2 2 2 2 3 3
 1
88 38
9 143 135 72 74 12 120 27 108 183 18 24 163 122 140 155 166 188 197 14 134 66 188 161 79 100 40 55 161 118 121 18 72 141 136 31 39 187 2 98 16 118 120 196 127 66 135 186 49 16 17 50 107 192 50 23 62 110 83 124 197 127 185 129 131 182 45 147 174 115 89 109 177 7 70 43 75 5 157 93 59 26 176 105 32 89 65 6
 5
7 3
1 1 1 2 1 3 1
5 1
5 5 5 5 5
4 2
1 3 3 7
2 0
4 2
10 5
3 3 3 4 4 4 5 5 5 1
 1
87 12
10 5 11 7 16 16 8 11 14 11 4 4 3 7 16 12 2 3 3 13 1 7 11 16 4 7 11 5 3 15 20 5 12 1 8 8 13 19 3 7 14 3 4 10 18 13 20 1 4 8 10 12 4 7 15 2 18 13 6 2 1 2 10 13 4 5 18 7 1 10 6 2 19 17 5 11 10 12 14 6 16 20 11 12 10 3 6
 1
16 8
1 1 2 2 3 3 3 3 3 3 3 3 3 4 5 5
 1
8 4
1 1 3 3 3 3 5 6
 1
12 6
1 1 1 8 8 8 8 8 8 10 10 10
 5
7 3
1 1 1 2 1 3 1
5 1
5 5 5 5 5
4 2
1 3 3 7
6 3
2 2 3 3 4 4
9 2
1 10 10 1 10 2 7 10 3
 1
12 6
1 1 1 1 1 2 2 2 2 3 3 3
 1
100 34
2 6 5 4 4 4 5 7 6 6 1 2 5 1 4 4 4 5 5 5 2 3 5 6 6 1 1 3 7 5 4 4 1 3 4 6 4 2 7 6 5 4 6 1 1 2 4 6 4 2 2 6 6 3 5 3 4 5 3 4 3 2 1 7 7 5 4 6 3 1 6 7 6 2 2 2 4 7 3 2 6 1 1 3 1 5 6 4 4 7 2 6 6 5 4 4 3 5 2 4
 1
85 3
43 17 34 67 14 7 80 48 36 95 48 68 86 4 17 46 51 87 41 90 100 56 57 42 9 8 27 23 16 14 99 22 13 98 89 24 77 59 15 94 25 81 4 71 24 43 97 88 97 10 6 8 3 86 28 61 100 98 76 85 32 18 79 66 51 44 28 99 87 56 80 93 89 76 7 57 96 39 46 25 4 67 6 51 39
 1
6 3
1 1 2 2 3 3
 1
6 3
2 3 3 3 4 4
 1
6 3
1 7 7 7 10 10
 1
10 3
1 7 4 3 2 2 6 7 4 7
 1
100 17
5 1 1 7 3 2 5 1 1 3 4 5 5 5 7 5 7 5 1 7 6 6 1 3 6 3 4 5 4 6 3 1 7 6 2 3 2 5 3 3 6 5 5 6 5 7 5 3 5 4 7 3 5 1 7 3 4 4 3 3 3 5 1 1 1 7 1 3 2 3 2 7 2 1 6 5 6 6 1 5 4 6 1 7 6 7 6 1 1 1 5 3 5 7 4 6 4 6 3 2
 1
7 3
1 1 1 2 2 3 3
 1
9 2
1 10 10 1 10 2 7 10 191919
 1
6 3
6 6 5 5 1 1
 1
8 3
1 1 6 6 6 6 2 2
 1
91 9
4 3 19 8 3 6 16 5 17 11 9 13 15 8 1 3 20 2 19 7 14 1 6 4 8 18 13 8 16 11 3 12 3 3 12 17 15 9 5 15 12 11 7 20 19 3 4 14 10 9 7 16 12 10 3 6 15 17 4 8 15 2 10 13 11 15 7 20 1 10 9 2 10 15 7 1 6 16 2 1 17 10 19 10 7 18 3 5 10 12 15
 1
67 22
83 41 94 76 47 33 20 51 98 48 92 72 24 51 15 17 35 70 83 95 79 65 80 17 72 7 97 14 74 98 55 63 45 79 42 92 85 24 84 30 29 77 64 68 68 71 89 18 82 68 20 91 84 52 45 23 65 95 83 84 18 81 63 11 89 41 69
 1
4 2
5 6 5 5
 1
6 3
3 3 4 4 7 7
 10
7 3
2 2 2 2 3 3 3
7 3
2 2 3 3 3 4 4
7 3
2 2 2 2 2 2 2
7 3
2 2 3 3 3 4 4
7 3
2 2 2 3 3 3 3
7 3
2 2 3 3 3 3 4
7 3
2 2 2 2 2 3 3
7 3
2 2 3 3 3 3 3
7 3
2 2 2 2 2 2 3
7 3
2 2 2 3 3 3 4
 1
7 3
2 2 2 2 7 8 2
 1
13 6
1 2 2 2 2 3 3 3 3 4 4 4 4
 1
10 3
1 1 1 1 1 1 2 2 3 3
 1
10 3
2 15 14 13 12 15 18 2 9 15
 1
8 4
1 2 2 2 2 3 3 3

0
 1
 3
 0
 2
 489
 0
 140
 2
16
0
6
0
 401
 1
 0
 0
 2
16
0
0
16
 0
 58
 3753
 0
 0
 0
 8
 192
 1
 22
 0
 3
 569
 616
 1
 0
 2
2
5
2
3
3
3
4
4
2
 3
 1
 4
 25
 0

        import java.beans.DesignMode;
        import java.io.BufferedReader;
        import java.io.FileInputStream;
        import java.io.FileNotFoundException;
        import java.io.IOException;
        import java.io.InputStreamReader;
        import java.util.*;
        import java.util.concurrent.LinkedBlockingDeque;
        import java.util.concurrent.CompletableFuture.AsynchronousCompletionTask;

        import org.xml.sax.ErrorHandler;

        import java.io.PrintStream;
        import java.io.PrintWriter;
        import java.io.DataInputStream;

        public class Solution {
                //TEMPLATE -------------------------------------------------------------------------------------
                public static boolean Local(){
                    try{ 
                        return System.getenv("LOCAL_SYS")!=null;
                    }catch(Exception e){
                        return false;
                    }
                }   

                public static boolean LOCAL;

                static class FastScanner {

                        BufferedReader br;
                        StringTokenizer st ;

                        FastScanner(){
                            br =  new BufferedReader(new InputStreamReader(System.in));
                            st = new StringTokenizer("");
                        }

                        FastScanner(String file) {

                            try{
                                br =  new BufferedReader(new InputStreamReader(new FileInputStream(file)));
                                st = new StringTokenizer("");
                            }catch(FileNotFoundException e) {
                                // TODO Auto-generated catch block
                                System.out.println("file not found");
                                e.printStackTrace();
                            }
                            
                        }
                        String next() {
                            while (!st.hasMoreTokens())
                                try {
                                    st = new StringTokenizer(br.readLine());
                                } catch (IOException e) {
                                }
                            return st.nextToken();
                        }

                        int nextInt() {
                            return Integer.parseInt(next());
                        }

                        long nextLong() {
                            return Long.parseLong(next());
                        }

                        double nextDouble(){
                            return Double.parseDouble(next());
                        }

                        String readLine() throws IOException{
                            return br.readLine();
                        }
                    }
                                        
                static class Pair<T,X> {

                    T first;
                    X second;
                    
                    Pair(T first,X second){
                        this.first = first;
                        this.second = second;
                    }

                    @Override
                    public int hashCode(){
                        return Objects.hash(first,second);
                    }

                    @Override
                    public boolean equals(Object obj){
                        return obj.hashCode() == this.hashCode();
                    }

                }

            
            static PrintStream debug = null;      
            static long mod = (long)(Math.pow(10,9) + 7); 
        //TEMPLATE -------------------------------------------------------------------------------------END//
            public static void main(String[] args) throws Exception {
                
                FastScanner s = new FastScanner();
                LOCAL = Local();
                //PrintWriter pw = new PrintWriter(System.out);
                if(LOCAL){
                    s = new FastScanner("src/input.txt");
                    PrintStream o = new PrintStream("src/sampleout.txt");
                    debug = new PrintStream("src/debug.txt");
                    System.setOut(o);
                //  pw = new PrintWriter(o);
                } long mod = 1000000007;

            
                int tcr = s.nextInt();                  
                StringBuilder sb = new StringBuilder();
            

                for(int tc=0;tc<tcr;tc++){        
                   int n = s.nextInt();
                   int k = s.nextInt();
                   int arr[] = new int[n];
                   for(int i=0;i<n;i++){
                       arr[i] = s.nextInt();
                   }    
                   sort(arr);
                   int dp[][][] = new int[n][n][k+1];
                   for(int ar[][] : dp){
                       for(int ar1[]:ar){
                        Arrays.fill(ar1,-1);
                       }
                    }

                    sb.append(solve(0,n-1,dp,k,arr)+"\n");
                }

                print(sb.toString());
            }

            public static int solve(int st,int e,int dp[][][],int k,int arr[]){
                if(k==0){
                    int sum = 0;
                    for(int i=st;i<=e;i++){
                        sum+=arr[i];
                    }
                    return sum;
                }
                if(dp[st][e][k] != -1){
                    return dp[st][e][k];
                }
                int op1 = (arr[e-1]/arr[e]) + solve(st,e-2,dp,k-1,arr);
                int op2 = (arr[st]/arr[e]) +  solve(st+1,e-1,dp,k-1,arr);
                dp[st][e][k] = Math.min(op1,op2);
                return dp[st][e][k];
            }


            public static List<int[]> print_prime_factors(int n){
            
                List<int[]> list = new ArrayList<>();
                
                for(int i=2;i<=(int)(Math.sqrt(n));i++){

                    if(n % i == 0){
                        
                        int cnt = 0;
                        
                        while( (n % i) == 0){
                            n = n/i;
                            cnt++;
                        }

                        list.add(new int[]{i,cnt});
                    }
                }

                if(n!=1){
                    list.add(new int[]{n,1});
                }

                return list;
            }

            public static List<int[]> prime_factors(int n,List<Integer> sieve){
                List<int[]> list = new ArrayList<>();
                int index = 0;
                while(n > 1 && sieve.get(index) <= Math.sqrt(n)){
                    int curr = sieve.get(index);
                    int cnt = 0;
                    while((n % curr) == 0){
                        n = n/curr;
                        cnt++;
                    }
                    if(cnt >= 1){
                        list.add(new int[]{curr,cnt});
                    }
                    index++;
                }
                if(n > 1){
                    list.add(new int[]{n,1});
                }
                return list;
            }

            public static boolean inRange(int r1,int r2,int val){
                return ((val >= r1) && (val <= r2));
            }

            static int len(long num){
                return Long.toString(num).length();
            }

            static long mulmod(long a, long b,long mod)
            {
                long ans = 0l;
                
                while(b > 0){
                    long curr = (b & 1l);
                    if(curr == 1l){
                        ans = ((ans % mod) + a) % mod;
                    }
                    
                    a = (a + a) % mod;

                    b = b >> 1;
                }

                return ans;
            }


            public static void dbg(PrintStream ps,Object... o) throws Exception{
                if(ps == null){
                    return;
                }
                Debug.dbg(ps,o);
            }

            public static long modpow(long num,long pow,long mod){

                long val = num;
                long ans = 1l;

                while(pow > 0l){
                    
                    long bit = pow & 1l;

                    if(bit == 1){
                        ans = (ans * (val%mod))%mod;
                    }

                    val = (val * val) % mod;
                    pow = pow >> 1;
                }

                return ans;

            }

            public static long pow(long num,long pow){

                long val = num;
                long ans = 1l;

                while(pow > 0l){
                    
                    long bit = pow & 1l;

                    if(bit == 1){
                        ans = (ans * (val));
                    }

                    val = (val * val);
                    pow = pow >> 1;
                }

                return ans;
            }
            
            public static char get(int n){
                return (char)('a' + n);
            }

            public static long[] sort(long arr[]){
                List<Long> list = new ArrayList<>();
                for(long n : arr){list.add(n);}
                Collections.sort(list);
                for(int i=0;i<arr.length;i++){
                    arr[i] = list.get(i);
                }
                return arr;
            }

            public static int[] sort(int arr[]){
                List<Integer> list = new ArrayList<>();
                for(int n : arr){list.add(n);}
                Collections.sort(list);
                for(int i=0;i<arr.length;i++){
                    arr[i] = list.get(i);
                }
                return arr;
            }

            // return the (index + 1)
            // where index is the pos of just smaller element
            // i.e count of elemets strictly less than num
            public static int justSmaller(long arr[],long num){
                //  System.out.println(num+"@");
                int st = 0;
                int e = arr.length - 1;

                int ans = -1;

                while(st <= e){

                    int mid = (st + e)/2;

                    if(arr[mid] >= num){
                        e = mid - 1;
                    }else{
                        ans = mid;
                        st = mid + 1;
                    }

                }


                return ans + 1;

            }
            public static int justSmaller(int arr[],int num){
                //  System.out.println(num+"@");
                int st = 0;
                int e = arr.length - 1;

                int ans = -1;

                while(st <= e){

                    int mid = (st + e)/2;

                    if(arr[mid] >= num){
                        e = mid - 1;
                    }else{
                        ans = mid;
                        st = mid + 1;
                    }

                }


                return ans + 1;

            }
            
            //return (index of just greater element)
            //count of elements smaller than or equal to num

            public static int justGreater(long arr[],long num){
                int st = 0;
                int e = arr.length - 1;

                int ans = arr.length;

                while(st <= e){
                    
                    int mid = (st + e)/2;

                    if(arr[mid] <= num){
                        st = mid + 1;
                    }else{
                        ans = mid;
                        e = mid - 1;
                    }
                }

                return ans;

            }

            public static int justGreater(int arr[],int num){
                int st = 0;
                int e = arr.length - 1;

                int ans = arr.length;

                while(st <= e){
                    
                    int mid = (st + e)/2;

                    if(arr[mid] <= num){
                        st = mid + 1;
                    }else{
                        ans = mid;
                        e = mid - 1;
                    }
                }

                return ans;

            }

            

            public static void println(Object obj){
                System.out.println(obj.toString());
            }

            public static void print(Object obj){
                System.out.print(obj.toString());
            }

            public static int gcd(int a,int b){
                if(b == 0){return a;}
                return gcd(b,a%b);
            }

            public static long gcd(long a,long b){
                if(b == 0l){
                    return a;
                }

                return gcd(b,a%b);
            }

            public static int find(int parent[],int v){
                if(parent[v] == v){
                    return v;
                }
                
                return parent[v] = find(parent, parent[v]);
            }



            public static List<Integer> sieve(){
            
                    List<Integer> prime = new ArrayList<>();

                    int arr[] = new int[1000001];

                Arrays.fill(arr,1);

                arr[1] = 0;
                arr[2] = 1;

                for(int i=2;i<1000001;i++){
                    
                    if(arr[i] == 1){
                        
                        prime.add(i);

                        for(long j = (i*1l*i);j<1000001;j+=i){
                            arr[(int)j] = 0;
                        }
                    }
                }

                return prime;
            }

            static boolean isPower(long n,long a){
                
                long log = (long)(Math.log(n)/Math.log(a));

                long power = (long)Math.pow(a,log);

                if(power == n){return true;}

                return false;
            }


            private static int mergeAndCount(int[] arr, int l,int m, int r)
            {
                // Left subarray
                int[] left =  Arrays.copyOfRange(arr, l, m + 1);

                // Right subarray
                int[] right = Arrays.copyOfRange(arr, m + 1, r + 1);

                int i = 0, j = 0, k = l, swaps = 0;

                while (i < left.length && j < right.length) {
                    if (left[i] <= right[j])
                        arr[k++] = left[i++];
                    else {
                        arr[k++] = right[j++];
                        swaps += (m + 1) - (l + i);
                    }
                }
                while (i < left.length)
                    arr[k++] = left[i++];
                while (j < right.length)
                    arr[k++] = right[j++];
                return swaps;
            }

            // Merge sort function
            private static int mergeSortAndCount(int[] arr, int l,int r)
            {

                // Keeps track of the inversion count at a
                // particular node of the recursion tree
                int count = 0;

                if (l < r) {
                    int m = (l + r) / 2;

                    // Total inversion count = left subarray count
                    // + right subarray count + merge count

                    // Left subarray count
                    count += mergeSortAndCount(arr, l, m);

                    // Right subarray count
                    count += mergeSortAndCount(arr, m + 1, r);

                    // Merge count
                    count += mergeAndCount(arr, l, m, r);
                }

                return count;
            }

            static class Debug{
                //change to System.getProperty("ONLINE_JUDGE")==null; for CodeForces
                public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

                

                private static <T> String ts(T t) {
                    if(t==null) {
                        return "null";
                    }
                    try {
                        return ts((Iterable<T>) t);
                    }catch(ClassCastException e) {
                        if(t instanceof int[]) {
                            String s = Arrays.toString((int[]) t);
                            return "{"+s.substring(1, s.length()-1)+"}\n";
                        }else if(t instanceof long[]) {
                            String s = Arrays.toString((long[]) t);
                            return "{"+s.substring(1, s.length()-1)+"}\n";
                        }else if(t instanceof char[]) {
                            String s = Arrays.toString((char[]) t);
                            return "{"+s.substring(1, s.length()-1)+"}\n";
                        }else if(t instanceof double[]) {
                            String s = Arrays.toString((double[]) t);
                            return "{"+s.substring(1, s.length()-1)+"}\n";
                        }else if(t instanceof boolean[]) {
                            String s = Arrays.toString((boolean[]) t);
                            return "{"+s.substring(1, s.length()-1)+"}\n";
                        }
                        try {
                            return ts((Object[]) t);
                        }catch(ClassCastException e1) {
                            return t.toString();
                        }
                    }
                }
                private static <T> String ts(T[] arr) {
                    StringBuilder ret = new StringBuilder();
                    ret.append("{");
                    boolean first = true;
                    for(T t: arr) {
                        if(!first) {
                            ret.append(", ");
                        }
                        first = false;
                        ret.append(ts(t));
                    }
                    ret.append("}");
                    return ret.toString();
                }
                private static <T> String ts(Iterable<T> iter) {
                    StringBuilder ret = new StringBuilder();
                    ret.append("{");
                    boolean first = true;
                    for(T t: iter) {
                        if(!first) {
                            ret.append(", ");
                        }
                        first = false;
                        ret.append(ts(t));
                    }
                    ret.append("}\n");
                    return ret.toString();
                }
                public static void dbg(PrintStream ps,Object... o) throws Exception {
                    if(LOCAL) {
                        System.setErr(ps);
                        System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [\n");
                        for(int i = 0; i<o.length; i++) {
                            if(i!=0) {
                                System.err.print(", ");
                            }
                            System.err.print(ts(o[i]));
                        }
                        System.err.println("]");
                    }
                }
            }

        }