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.util.*;
  
  public class CodeForces{
      /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/
  
      public static void main(String[] args) throws IOException{
          openIO();
          int testCase = 1;
          testCase = sc.nextInt();
          for (int i = 1; i <= testCase; i++) solve(i);
          closeIO();
      }
      public static void solve(int tCase)throws IOException {
         int n = sc.nextInt();
         int k = sc.nextInt();
         int[] arr = new int[n];
         for(int i=0;i<n;i++)arr[i] = sc.nextInt();
         _sort(arr,true);
         int sum = 0;
         int ind = n-1;
         int cnt  = 0;
         while(cnt<k){
             sum+= arr[ind-k] / arr[ind];
             ind--;
             cnt++;
         }
         for(int i=0;i<=ind-k;i++)sum+=arr[i];
         out.println(sum);
      }
     
  
  
  
      /*-------------------------------------------EDITING CODE ENDS HERE-------------------------------------------*/
      static FastestReader sc;
      static PrintWriter out;
      private static void openIO() throws IOException{
          sc = new FastestReader();
          out = new PrintWriter(System.out);
      }
  
      /*------------------------------------------HELPER FUNCTION STARTS HERE------------------------------------------*/
  
      public static int mod = (int) 1e9 + 7;
      private static int mod2 =  998244353;
      public static int inf_int = (int) 2e9 + 10;
      public static  long inf_long = (long) 2e15;
  
  
      public static int _digitCount(long num,int base){
          return (int)(1 + Math.log(num)/Math.log(base));
      }
      public static long _fact(int n){
          long ans = 1;
          for(int i=2;i<=n;i++)
              ans = ans * i % mod;
          return ans;
      }
      // time : O(r)
      public static int _ncr(int n,int r){
          if (r > n) return 0;
          long[]  inv = new long[r + 1];
          inv[0] = 1;
          if(r+1>=2)
              inv[1] = 1;
  
          // Getting the modular inversion
          // for all the numbers
          // from 2 to r with respect to mod
          for (int i = 2; i <= r; i++)
              inv[i] = mod - (mod / i) * inv[(mod % i)] % mod;
  
          int ans = 1;
  
          // for 1/(r!) part
          for (int i = 2; i <= r; i++)
              ans = (int) (((ans % mod) * (inv[i] % mod)) % mod);
  
          // for (n)*(n-1)*(n-2)*...*(n-r+1) part
          for (int i = n; i >= (n - r + 1); i--)
              ans =  (((ans % mod) * (i % mod)) % mod);
          return ans;
      }
  
      // euclidean algorithm time O(max (loga ,logb))
      public static long _gcd(long a, long b) {
          if (a == 0)
              return b;
          return _gcd(b % a, a);
      }
  
      public static long _lcm(long a, long b) {
          // lcm(a,b) * gcd(a,b) = a * b
          return (a / _gcd(a, b)) * b;
      }
  
  
      // binary exponentiation time O(logn)
      public static long _power(long x, long n) {
          long ans = 1;
          while (n > 0) {
              if ((n & 1) == 1) {
                  ans *= x;
                  ans %= mod;
                  n--;
              } else {
                  x *= x;
                  x %= mod;
                  n >>= 1;
              }
          }
          return ans;
      }
      //sieve/first divisor time : O(mx * log ( log (mx) ) )
      public static int[]  _seive(int mx){
          int[] firstDivisor = new int[mx+1];
          for(int i=0;i<=mx;i++)firstDivisor[i] = i;
          for(int i=2;i*i<=mx;i++)
              if(firstDivisor[i] == i)
                  for(int j = i*i;j<=mx;j+=i)
                      firstDivisor[j] = i;
          return firstDivisor;
      }
  
      private static boolean _isPrime(long x){
          for(long i=2;i*i<=x;i++)
              if(x%i==0)return false;
          return true;
      }
  
      public static void _sort(int[] arr,boolean isAscending){
          int n = arr.length;
          List<Integer> list = new ArrayList<>();
          for(int ele : arr)list.add(ele);
          Collections.sort(list);
          if(!isAscending)Collections.reverse(list);
          for(int i=0;i<n;i++)arr[i] = list.get(i);
      }
  
      public static void _sort(long[] arr,boolean isAscending){
          int n = arr.length;
          List<Long> list = new ArrayList<>();
          for(long ele : arr)list.add(ele);
          Collections.sort(list);
          if(!isAscending)Collections.reverse(list);
          for(int i=0;i<n;i++)arr[i] = list.get(i);
      }
      /*------------------------------------------HELPER FUNCTION ENDS HERE-------------------------------------------*/
  
      /*-------------------------------------------FAST INPUT STARTS HERE---------------------------------------------*/
  
      public static void closeIO() throws IOException{
          out.flush();
          out.close();
          sc.close();
      }
      private static final class FastestReader {
          private static final int BUFFER_SIZE = 1 << 16;
          private final DataInputStream din;
          private final byte[] buffer;
          private int bufferPointer, bytesRead;
  
          public FastestReader() {
              din = new DataInputStream(System.in);
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public FastestReader(String file_name) throws IOException {
              din = new DataInputStream(new FileInputStream(file_name));
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
  
          private int skip() throws IOException {
              int b;
              //noinspection StatementWithEmptyBody
              while ((b = read()) != -1 && isSpaceChar(b)) {}
              return b;
          }
  
          public String next() throws IOException {
              int b = skip();
              final StringBuilder sb = new StringBuilder();
              while (!isSpaceChar(b)) { // when nextLine, (isSpaceChar(b) && b != ' ')
                  sb.appendCodePoint(b);
                  b = read();
              }
              return sb.toString();
          }
  
          public int nextInt() throws IOException {
              int ret = 0;
              byte c = read();
              while (c <= ' ') {
                  c = read();
              }
              final boolean neg = c == '-';
              if (neg) { c = read(); }
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (neg) { return -ret; }
              return ret;
          }
  
          public long nextLong() throws IOException {
              long ret = 0;
              byte c = read();
              while (c <= ' ') { c = read(); }
              final boolean neg = c == '-';
              if (neg) { c = read(); }
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
              if (neg) { return -ret; }
              return ret;
          }
  
          public double nextDouble() throws IOException {
              double ret = 0, div = 1;
              byte c = read();
              while (c <= ' ') { c = read(); }
              final boolean neg = c == '-';
              if (neg) { c = read(); }
  
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (c == '.') {
                  while ((c = read()) >= '0' && c <= '9') {
                      ret += (c - '0') / (div *= 10);
                  }
              }
  
              if (neg) { return -ret; }
              return ret;
          }
  
          private void fillBuffer() throws IOException {
              bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
              if (bytesRead == -1) { buffer[0] = -1; }
          }
  
          private byte read() throws IOException {
              if (bufferPointer == bytesRead) { fillBuffer(); }
              return buffer[bufferPointer++];
          }
  
          public void close() throws IOException {
              din.close();
          }
      }
      /*---------------------------------------------FAST INPUT ENDS HERE ---------------------------------------------*/
  }