description: 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.
solution: import java.io.*;
  import java.math.BigInteger;
  import java.util.*;
  import java.util.concurrent.ThreadLocalRandom;
  
  public class Main extends Utils{
      public static void main(String[] args) {
          int t = readInt();
          while (t-- > 0) {
              int n = readInt(), k = readInt();
              int[] a = readArrayInt(n);
  
              Arrays.sort(a);
  
              long rs = 0;
              for (int i = 0; i < n - 2*k; i++)
                  rs += a[i];
              for (int i = n - 2*k; i < n - k; i++)
                  rs += a[i] / a[i + k];
  
              println(rs);
  
          }
  
          flush();
      }
  }
  
  class Tuple {
      int _1;
      int _2;
  
      Tuple(int _1, int _2) {
          this._1 = _1;
          this._2 = _2;
      }
  }
  
  class DSU {
      int[] p;
  
      DSU(int size) {
          p = new int[size];
          Arrays.fill(p, -1);
      }
  
      int root(int u) {
          if (p[u] < 0) return u;
          return p[u] = root(p[u]);
      }
  
      void join(int u, int v) {
          int x = root(u);
          int y = root(v);
          if (x == y) return;
  
          if (p[y] < p[x]) {
              int t = x; x = y; y = t;
          }
          p[x] += p[y];
          p[y] = x;
      }
  }
  
  class ST {
      int[] lazy;
      int[][] f;
  
      ST(int n) {
          int size = 4 * Integer.highestOneBit(n);
          f = new int[size][4];
          lazy = new int[size];
      }
  
      /*private void down(int id) {
          if (lazy[id] == Integer.MAX_VALUE) return;
          f[(id << 1) + 1] = lazy[id];
          f[(id << 1) + 2] = lazy[id];
  
          lazy[(id << 1) + 1] = lazy[id];
          lazy[(id << 1) + 2] = lazy[id];
  
          lazy[id] = Integer.MAX_VALUE;
      }*/
  
      /*HashSet[] merge(HashSet<Integer> x, HashSet<Integer> y) {
          int[] rs = new int[(x.length) + y.length];
          int i = 0, j = 0, idx = 0;
          while (i < x.length && j < y.length) {
              if (x[i] < y[j])
                  rs[idx++] = x[i++];
              else
                  rs[idx++] = y[j++];
          }
  
          while (i < x.length)
              rs[idx++] = x[i++];
          while (j < y.length)
              rs[idx++] = y[j++];
          return rs;
      }*/
  
      void build(int id, int l, int r, int[] value) {
          if (l == r) {
               {
                  f[id][0] = value[l];
                  f[id][1] = value[l];
                  f[id][2] = value[l];
              }
              f[id][3] = value[l];
              return;
          }
          int mid = (l + r) >> 1;
          build((id << 1) + 1, l, mid, value);
          build((id << 1) + 2, mid + 1, r, value);
          int[] rs1 = f[(id << 1) + 1];
          int[] rs2 = f[(id << 1) + 2];
          f[id][0] = Math.max(rs1[2] + rs2[1], Math.max(rs1[0], rs2[0]));
          f[id][1] = Math.max(rs1[1], rs1[3] + rs2[1]);
          f[id][2] = Math.max(rs2[2], rs2[3] + rs1[2]);
          f[id][3] = rs1[3] + rs2[3];
      }
  
      /* void update(int id, int l, int r, int u, int v, int value) {
          if (u > r || v < l) return;
          if (u <= l && r <= v) {
              f[id] = value;
              lazy[id] = value;
              return;
          }
          down(id);
          int mid = (l + r) >> 1;
          update((id << 1) + 1, l, mid, u, v, value);
          update((id << 1) + 2, mid + 1, r, u, v, value);
          f[id][0] = Math.max(f[(id << 1) + 1][0], f[(id << 1) + 2][0]);
      }*/
  
      int[] get(int id, int l, int r, int u, int v) {
          if (u > r || v < l) return new int[]{-1000000001, -1000000001, -1000000001, 0};
          if (u <= l && r <= v) return f[id];
          //down(id);
          int mid = (l + r) >> 1;
          int[] rs1 = get((id << 1) + 1, l, mid, u, v);
          int[] rs2 = get((id << 1) + 2, mid + 1, r, u, v);
          int max = Math.max(rs1[2] + rs2[1], Math.max(rs1[0], rs2[0]));
          int left = Math.max(rs1[1], rs1[3] + rs2[1]);
          int right = Math.max(rs2[2], rs2[3] + rs1[2]);
          int all = rs1[3] + rs2[3];
          return new int[]{max, left, right, all};
      }
  }
  
  class BIT {
      int n;
      int[] bit;
  
      BIT(int n) {
          this.n = n;
          bit = new int[n + 1];
      }
  
      void update_dec(int i, int value) {
          for (; i > 0; i -= i & (-i))
              bit[i] += value;
      }
  
      void update_inc(int i, int value) {
          for (; i <= n; i += i & (-i))
              bit[i] += value;
      }
  
      int get_inc(int i) {
          int rs = 0;
          for (; i <= n; i += i & (-i))
              rs += bit[i];
          return rs;
      }
  
      int get_dec(int i) {
          int rs = 0;
          for (; i > 0; i -= i & (-i))
              rs += bit[i];
          return rs;
      }
  
  }
  
  class LCA {
      int[][] rmq;
      long[][] len;
      int[] d;
      int maxH;
  
      LCA (int n, int root, ArrayList<int[]>[] e) {
          maxH = (int)(Math.log(n) / Math.log(2) + 1);
  
          d = new int[n];
          rmq = new int[n][maxH + 1];
          len = new long[n][maxH + 1];
  
          dfs(root, n, e);
      }
  
      long get(int u, int v) {
          if (d[u] < d[v]) {
              int t = u; u = v; v = t;
          }
  
          long slen = 0;
          for (int i = maxH; i >= 0; i--)
              if (d[u] - d[v] >= (1 << i)) {
                  slen += len[u][i];
                  u = rmq[u][i];
              }
  
          if (u == v) return slen;
  
          for (int i = maxH; i >= 0; i--)
              if (rmq[u][i] != rmq[v][i]) {
                  slen += len[u][i] + len[v][i];
                  u = rmq[u][i];
                  v = rmq[v][i];
              }
  
          slen += len[u][0] + len[v][0];
  
          return slen;
      }
  
      int query(int _u, int _v, int k) {
          int u = _u, v = _v;
          if (d[u] < d[v]) {
              int t = u; u = v; v = t;
          }
  
          for (int i = maxH; i >= 0; i--)
              if (d[u] - d[v] >= (1 << i))
                  u = rmq[u][i];
  
          int p = 0;
          if (u == v)
              p = u;
          else {
              for (int i = maxH; i >= 0; i--)
                  if (rmq[u][i] != rmq[v][i]) {
                      u = rmq[u][i];
                      v = rmq[v][i];
                  }
              p = rmq[u][0];
          }
  
          if (d[_u] - d[p] >= k) {
              for (int i = maxH; i >= 0; i--) {
                  if (d[_u] - d[p] >= k && k >= (1 << i)) {
                      _u = rmq[_u][i];
                      k -= 1 << i;
                  }
              }
              return _u;
          } else {
              k -= d[_u] - d[p];
              k = d[_v] - d[p] - k;
              for (int i = maxH; i >= 0; i--) {
                  if (d[_v] - d[p] >= k && k >= (1 << i)) {
                      _v = rmq[_v][i];
                      k -= 1 << i;
                  }
              }
              return _v;
          }
      }
  
      private void dfs(int u, int n, ArrayList<int[]>[] e) {
          for (int[] vw : e[u]) {
              int v = vw[0];
              int w = vw[1];
              if (v != rmq[u][0]) {
                  rmq[v][0] = u;
                  len[v][0] = w;
  
                  for (int i = 1; (1 << i) <= n; i++) {
                      rmq[v][i] = rmq[rmq[v][i - 1]][i - 1];
                      len[v][i] =len[rmq[v][i - 1]][i - 1] + len[v][i - 1];
                  }
                  d[v] = d[u] + 1;
                  dfs(v, n, e);
              }
          }
      }
  }
  
  class HLD {
      int[] idx, parent, link, pos, value;
      ArrayList<ArrayList<Integer>> chain;
      ST[] st;
  
      HLD(int n, int root, ArrayList<int[]>[] e) {
          idx = new int[n];
          parent = new int[n];
          link = new int[n];
          pos = new int[n];
          value = new int[n];
          chain = new ArrayList<>();
  
          dfs(root, e);
  
          for (int u = 0; u < n; u++) {
              if (u == root || link[parent[u]] != u) {
                  chain.add(new ArrayList<>());
                  int curr = chain.size() - 1;
                  for (int v = u; v >=0; v = link[v]) {
                      pos[v] = chain.get(curr).size();
                      chain.get(curr).add(v);
                      idx[v] = curr;
                  }
              }
          }
  
          st = new ST[chain.size()];
          for (int i = 0; i < chain.size(); i++) {
              st[i] = new ST(chain.get(i).size());
  
              int[] mapValue = new int[chain.get(i).size()];
              for (int j = 0; j < mapValue.length; j++)
                  mapValue[j] = value[chain.get(i).get(j)];
  
              st[i].build(0, 0, chain.get(i).size() - 1, mapValue);
          }
      }
  
      private int dfs(int u, ArrayList<int[]>[] e) {
          link[u] = -1;
  
          int maxS = 0, sumS = 1;
          for (int[] vw : e[u]) {
              int v = vw[0], w = vw[1];
              if (v != parent[u]) {
                  parent[v] = u;
                  value[u] = w;
                  int size = dfs(v, e);
                  if (size > maxS) {
                      maxS = size;
                      link[u] = v;
                  }
                  sumS += size;
              }
          }
          return sumS;
      }
  
      /*int get(int u, int v) {
          if (idx[u] != idx[v]) {
              int rs = get(u, parent[chain.get(idx[v]).get(0)]);
              if (rs > 0) return rs;
              return get(chain.get(idx[v]).get(0), v);
  
          }
          return st[idx[u]].get(0, 0, chain.get(idx[u]).size() - 1, pos[u], pos[v]);
      }
  
      void update(int u) {
          value[u] ^= 1;
          st[idx[u]].update(0, 0, chain.get(idx[u]).size() - 1, pos[u], pos[u], value[u] > 0 ? u + 1 : 0);
      }*/
  
     /* int get(int u, int v) {
          int[] rs2 = new int[]{-1000000001, -1000000001, -1000000001, 0};;
          while(idx[u] != idx[v]) {
              if (idx[u] > idx[v]) {
                  int t = u; u = v; v = t;
              }
              int[] rs1 = st[idx[v]].get(0, 0, chain.get(idx[v]).size() - 1, pos[chain.get(idx[v]).get(0)], pos[v]);
              int max = Math.max(rs1[2] + rs2[1], Math.max(rs1[0], rs2[0]));
              int left = Math.max(rs1[1], rs1[3] + rs2[1]);
              int right = Math.max(rs2[2], rs2[3] + rs1[2]);
              int all = rs1[3] + rs2[3];
              rs2 = new int[]{max, left, right, all};
              v = parent[chain.get(idx[u]).get(0)];
          }
          int[] rs1 = st[idx[u]].get(0, 0, chain.get(idx[u]).size() - 1, Math.min(pos[u], pos[v]) + 1, Math.max(pos[u], pos[v]));
          return Math.max(rs1[2] + rs2[1], Math.max(rs1[0], rs2[0]));
      }
  
      void update(int u, int v, int w) {
          while(idx[u] != idx[v]) {
              if (idx[v] < idx[u]) {
                  int t = u; u = v; v = t;
              }
              st[idx[v]].update(0, 0, chain.get(idx[v]).size() - 1, pos[chain.get(idx[v]).get(0)], pos[v], w);
              v = parent[chain.get(idx[u]).get(0)];
          }
          st[idx[u]].update(0, 0, chain.get(idx[u]).size() - 1, Math.min(pos[u], pos[v]), Math.max(pos[u], pos[v]), w);
      }*/
  }
  
  abstract class Utils {
      static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
      static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
      static StringTokenizer st = new StringTokenizer("");
  
      static void print(Object s) {
          writer.print(s);
      }
  
      static void println(Object s) {
          writer.println(s);
      }
  
      static void println() {
          writer.println();
      }
  
      static void flush() {
          writer.close();
      }
  
      static String next() {
          while (!st.hasMoreTokens()) {
              try {
                  st = new StringTokenizer(reader.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      static int readInt() {
          return Integer.parseInt(next());
      }
  
      static long readLong() {
          return Long.parseLong(next());
      }
  
      static char[] readStr() {
          return next().toCharArray();
      }
  
      static String readString() {
          return next();
      }
  
      static char readChar() {
          return next().charAt(0);
      }
  
      static int[] readArrayInt(int n) {
          int[] a = new int[n];
          for(int i = 0; i < n; i++)
              a[i] = readInt();
          return a;
      }
  
      static long[] readArrayLong(int n) {
          long[] a = new long[n];
          for(int i = 0; i < n; i++)
              a[i] = readLong();
          return a;
      }
  
      static BigInteger pow(BigInteger a, BigInteger b) {
          if (b.compareTo(BigInteger.valueOf(0)) == 0) return BigInteger.valueOf(1);
          BigInteger rs = pow(a, (b.divide(BigInteger.valueOf(2))));
          return rs.multiply(rs).multiply(b.mod(BigInteger.valueOf(2)).compareTo(BigInteger.ZERO) == 0 ? BigInteger.ONE : a);
      }
  
      static long pow(long a, long b) {
          if (b == 0) return 1;
  
          long rs = pow(a, b / 2);
          return rs * rs * (b % 2 == 0 ? 1 : a);
      }
  
      static long GCD(long a, long b) {
          if (a == 0) return b;
          return GCD(b % a, a);
      }
  
      static long LCM(long a, long b) {
          return (a / GCD(a,b)) * b;
      }
  
      static void shuffle(int[][] a) {
          Random rand = ThreadLocalRandom.current();
          for (int i = a.length - 1; i >= 0; i--) {
              int idx = rand.nextInt(i + 1);
              int[] t = a[idx];
              a[idx] = a[i];
              a[i] = t;
          }
      }
  }
  
  
  