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.util.*;
import java.io.*;
import java.math.*;

public class Main {
    // ArrayList<Integer> al = new ArrayList<>();
    // ArrayList<Pair<Integer, Integer>> al = new ArrayList<>();
    // Set<Integer> set = new TreeSet<>();
    // Pair<Integer, Integer> pair;
    // Map<Integer, Integer> map = new HashMap<>();
    // LinkedList<Integer> ll = new LinkedList<>();
    // for(Map.Entry<Integer,Integer> e:map.entrySet())pn(e.getKey()+"
    // "+e.getValue());
    // map.put(key,map.getOrDefault(key,0)+1);

    // *********************** Code Begins From Here*************************

    public static void solve() {
        int n = c.i(), k = c.i(), k1 = k, a[] = c.intArray(n), ind1 = -1, ind2 = -1;
        long sum1 = 0, sum2 = 0;
        sort(a);
        int b[] = copy(a);
        // watch(a);
        for (int i = 0; i < n && k > 0; i++) {
            ind1 = i;
            if (a[i] == -1)
                continue;
            int j = n - 1, min = IMAX;
            while (j >= 0) {
                if (min > min(a[i] / a[j], a[j] / a[i])) {
                    min = min(a[i] / a[j], a[j] / a[i]);
                    ind1 = i;
                    ind2 = j;
                }
                j--;
            }
            sum1 += min;
            a[ind1] = -1;
            a[ind2] = -1;
            k--;
            // pn(k + " " + sum1 + " " + min + " " + Arrays.toString(a));
            if (k == 0)
                break;
        }
        for (int e : a)
            if (e != -1)
                sum1 += e;
        // pn(sum1);
        for (int i = n - 2; i >= 0 && k1 > 0; i -= 2) {
            sum2 += b[i] / b[i + 1];
            b[i] = -1;
            b[i + 1] = -1;
            k1--;
            // pn(k1 + " " + sum2 + " " + Arrays.toString(b));
            if (k1 == 0)
                break;
        }
        // watch(b);
        for (int e : b)
            if (e != -1)
                sum2 += e;
        // pn(sum1 + " " + sum2);
        pn(min(sum1, sum2));
    }

    static int printpairs(int arr[], long sum) {
        int cnt = 0;
        HashSet<Long> s = new HashSet<>();
        for (int i = 0; i < arr.length; ++i) {
            long temp = sum - arr[i];

            // checking for condition
            if (s.contains(temp))
                cnt++;
            s.add((long) arr[i]);
        }
        return cnt;
    }

    public static void main(String[] args) throws FileNotFoundException {
        c = new FastScanner();
        pw = new PrintWriter(System.out);
        int tc = 1;
        tc = c.i();
        long start = System.currentTimeMillis();
        for (int t = 0; t < tc; t++) {
            // p("Case #" + (t + 1) + ": ");
            solve();
        }
        long end = System.currentTimeMillis();
        if (System.getProperty("os.name").equals("Mac OS X")) {
            pn("The Program takes " + (end - start) + "ms");
        }
        pw.close();
    }

    // math util
    private static int lower(int a[], int x) {
        int l = 0, r = a.length - 1, mid, ans = -1;
        while (l <= r) {
            mid = l + ((r - l) >> 1);
            if (a[mid] <= x) {
                ans = max(ans, mid);
                l = mid + 1;
            } else
                r = mid - 1;
        }
        return ans;
    }

    private static int upper(int a[], int x) {
        int l = 0, r = a.length - 1, mid, ans = -1;
        while (l <= r) {
            mid = l + ((r - l) >> 1);
            if (a[mid] >= x) {
                ans = mid;
                r = mid - 1;
            } else
                l = mid + 1;
            // pn(l + " " + mid + " " + r);
        }
        return ans;
    }

    private static int cei(double d) {
        return (int) Math.ceil(d);
    }

    private static long ceil(double d) {
        return (long) Math.ceil(d);
    }

    private static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    private static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    private static int abs(int a, int b) {
        return (int) Math.abs(a - b);
    }

    private static int abs(int a) {
        return (int) Math.abs(a);
    }

    private static long abs(long a) {
        return (long) Math.abs(a);
    }

    private static long abs(long a, long b) {
        return (long) Math.abs(a - b);
    }

    private static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    private static int min(int a, int b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    private static long max(long a, long b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    private static long min(long a, long b) {
        if (a > b) {
            return b;
        } else {
            return a;
        }
    }

    private static int pow(int base, int exp) {
        int result = 1;
        while (exp != 0) {
            if ((exp & 1) == 1)
                result *= base;
            exp >>= 1;
            base *= base;
        }
        return result;
    }

    private static long powerMod(long base, long exp, long mod) {
        long result = 1;
        base %= mod;
        while (exp > 0) {
            if ((exp & 1) != 0)
                result = (result * base) % mod;
            exp >>= 1;
            base = base * base % mod;
        }
        return result < 0 ? result + mod : result;
    }

    private static long addMod(long a, long b, long mod) {
        return (a % mod + b % mod) % mod;
    }

    private static long subMod(long a, long b, long mod) {
        return (a % mod - b % mod) % mod;
    }

    private static long mulMod(long a, long b, long mod) {
        return ((a % mod) * (b % mod)) % mod;
    }

    private static long pow(long base, long exp) {
        long result = 1;
        while (exp != 0) {
            if ((exp & 1) == 1)
                result = result * base;
            exp >>= 1;
            base *= base;
        }
        return result;
    }

    // array util
    private static void sortList(ArrayList<Integer> al) {
        Collections.sort(al);
    }

    private static void sortListP(ArrayList<Pair<Integer, Integer>> al) {
        Collections.sort(al);
    }

    private static void sort(int[] a) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int e : a)
            al.add(e);
        sortList(al);
        int i = 0;
        for (int e : al)
            a[i++] = e;
    }

    private static void sort(double[] a) {
        ArrayList<Double> al = new ArrayList<>();
        for (double e : a)
            al.add(e);
        Collections.sort(al);
        int i = 0;
        for (double e : al)
            a[i++] = e;
    }

    private static void sort(char[] a) {
        ArrayList<Character> al = new ArrayList<>();
        for (char e : a)
            al.add(e);
        Collections.sort(al);
        int i = 0;
        for (char e : al)
            a[i++] = e;
    }

    private static void sort(long[] a) {
        ArrayList<Long> al = new ArrayList<>();
        for (long e : a)
            al.add(e);
        Collections.sort(al);
        int i = 0;
        for (long e : al)
            a[i++] = e;
    }

    private static int[] copy(int[] a) {
        int[] ans = new int[a.length];
        for (int i = 0; i < a.length; ++i)
            ans[i] = a[i];
        return ans;
    }

    private static char[] copy(char[] a) {
        char[] ans = new char[a.length];
        for (int i = 0; i < a.length; ++i)
            ans[i] = a[i];
        return ans;
    }

    private static long[] copy(long[] a) {
        long[] ans = new long[a.length];
        for (int i = 0; i < a.length; ++i)
            ans[i] = a[i];
        return ans;
    }
    // output

    private static void pn(Object o) {
        pw.println(o);
    }

    private static void p(Object o) {
        pw.print(o);
    }

    private static void pry() {
        pn("Yes");
    }

    private static void pY() {
        pn("YES");
    }

    private static void prn() {
        pn("No");
    }

    private static void pN() {
        pn("NO");
    }

    private static void flush() {
        pw.flush();
    }

    private static void watch(int[] a) {
        for (int e : a)
            p(e + " ");
        pn("");
    }

    private static void watch(long[] a) {
        for (long e : a)
            p(e + " ");
        pn("");
    }

    private static void watch(char[] a) {
        for (char e : a)
            p(e);
        pn("");
    }

    private static void watchList(ArrayList<Integer> al) {
        for (int e : al)
            p(e + " ");
        pn("");
    }

    private static Set<Integer> putSet(int[] a) {
        Set<Integer> set = new TreeSet<>();
        for (int e : a)
            set.add(e);
        return set;
    }

    private static boolean[] sieve(int n) {
        boolean[] isPrime = new boolean[n + 1];
        Arrays.fill(isPrime, true);
        isPrime[0] = false;
        isPrime[1] = false;
        for (int i = 2; i * i <= n; i++) {
            for (int j = i * i; j <= n; j += i) {
                isPrime[j] = false;
            }
        }
        return isPrime;
    }

    private static class Pair<U, V> implements Comparable<Pair<U, V>> {
        public final U first;
        public V second;

        public <U, V> Pair<U, V> makePair(U first, V second) {
            return new Pair<U, V>(first, second);
        }

        public Pair(U first, V second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }

            Pair pair = (Pair) o;

            return !(first != null ? !first.equals(pair.first) : pair.first != null)
                    && !(second != null ? !second.equals(pair.second) : pair.second != null);
        }

        @Override
        public int hashCode() {
            int result = first != null ? first.hashCode() : 0;
            result = 31 * result + (second != null ? second.hashCode() : 0);
            return result;
        }

        public Pair<V, U> swap() {
            return makePair(second, first);
        }

        @Override
        public String toString() {
            return "(" + first + "," + second + ")";
        }

        @SuppressWarnings({ "unchecked" })
        public int compareTo(Pair<U, V> o) {
            int value = ((Comparable<U>) first).compareTo(o.first);
            if (value != 0) {
                return value;
            }
            return ((Comparable<V>) second).compareTo(o.second);
        }
    }

    private static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() throws FileNotFoundException {

            if (System.getProperty("os.name").equals("Mac OS X")) {
                // Input is a file
                br = new BufferedReader(new FileReader("input.txt"));

                // PrintWriter class prints formatted representations
                // of objects to a text-output stream.
                PrintStream pw = new PrintStream(new FileOutputStream("output.txt"));
                System.setOut(pw);
            } else {
                // Input is System.in
                br = new BufferedReader(new InputStreamReader(System.in), 32768);
                st = null;
            }

        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        int[] intArray(int n) {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++)
                ret[i] = i();
            return ret;
        }

        ArrayList<Integer> intList(int n) {
            ArrayList<Integer> al = new ArrayList<>();
            for (int i = 0; i < n; i++)
                al.add(i());
            return al;
        }

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

        long[] longArray(int n) {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++)
                ret[i] = l();
            return ret;
        }

        double[] doubleArray(int n) {
            double[] ret = new double[n];
            for (int i = 0; i < n; i++)
                ret[i] = l();
            return ret;
        }

        ArrayList<Long> longList(int n) {
            ArrayList<Long> al = new ArrayList<>();
            for (int i = 0; i < n; i++)
                al.add(l());
            return al;
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    private static boolean arr[] = sieve(1000001);
    private static ArrayList<Long> primes = new ArrayList<>();
    private static int freq[] = new int[200005];
    private static int mod = (int) (1e9 + 7);
    private static final int IMAX = 2147483647;
    private static final int IMIN = -2147483648;
    private static final long LMAX = 9223372036854775807L;
    private static final long LMIN = -9223372036854775808L;
    private static FastScanner c;
    private static PrintWriter pw;
}