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.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
  import java.util.*;
  import java.util.concurrent.ThreadLocalRandom;
  
  
  
  public class a729 {
  
  	public static void main(String[] args) throws IOException {
         BufferedWriter out = new BufferedWriter(
  	            new OutputStreamWriter(System.out));
  		BufferedReader br = new BufferedReader(
  		        new InputStreamReader(System.in));
  		PrintWriter pt = new PrintWriter(System.out);
  		FastReader sc = new FastReader();
  
  		int t = sc.nextInt();
  		for(int o = 0 ; o<t;o++){
  		int n = sc.nextInt();
  		int k = sc.nextInt();
  		int[] arr = new int[n];
  		for(int i = 0 ; i<n;i++) {
  			arr[i] = sc.nextInt();
  		}
  		Arrays.sort(arr);
  		int ans = 0;
  		for(int i = n-2*k-1; i>=0;i--){
  			ans+= arr[i];
  		}
  		int j = 0 ;
  		int i = n-1;
  		int x = n-1-k;
  	while(x>=0 && j<k) {
  		if(arr[i]==arr[x]) {
  			ans++;
  		}
  	i--;
  	x--;
  	j++;
  	}
  		System.out.println(ans);
  		}
  	}
  //------------------------------------------------------------------------------------------------------------------------------------------------
  	
  	public static boolean check(long[] arr,long g,int v) {
  		int n = arr.length;
  		for(int i = v ; i<n;i+=2) {
  			if(arr[i]%g ==0) {
  				return false;
  			}
  		}
  		return true;
  	}
  	
  	
  	public static long findgcd(long[] arr,int v) {
  		int n = arr.length;
  		long g = arr[v];
  		for(int i = v ; i<n;i+=2) {
  			g = gcd(g, arr[i]);
  		}
  		return g;
  	}
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	public static int count(long x) {
  		int a = 0;
  		while(x>0) {
  			x/=2;
  			a++;
  		}
  		return a;
  		
  	}
  	
  
  	public static long ncr(long[] fac, int n , int r , long m) {
  		return fac[n]*(modInverse(fac[r], m))%m *(modInverse(fac[n-r], m))%m; 
  	}
  	
  	
  	public static void build(int [][] seg,char []arr,int idx, int lo , int hi) {
  	if(lo == hi) {
  //		seg[idx] = arr[lo];
  		seg[idx][(int)arr[lo]-'a'] = 1;
  		
  		return;
  	}
  	int mid = (lo + hi)/2;
  build(seg,arr,2*idx+1, lo, mid);
  build(seg,arr,idx*2+2, mid +1, hi);
  //seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
  for(int i = 0 ; i<27;i++) {
  	seg[idx][i] = seg[2*idx+1][i] + seg[2*idx + 2][i];
  }
  	}
  //for f/inding minimum in range 
  public static void query(int[][]seg,int[]ans,int idx , int lo , int hi , int l , int r) {
  	if(lo>=l && hi<=r) {
  		for(int i = 0 ; i<27;i++) {
  			ans[i]+= seg[idx][i];
  		}
  		return ;
  	}
  if(hi<l || lo>r) {
  	return;
  }
  int mid = (lo + hi)/2;
  query(seg,ans,idx*2 +1, lo, mid, l, r);
  query(seg,ans,idx*2 + 2, mid + 1, hi, l, r);
  //return Math.min(left, right);
  }
  //// for sum
  //
  public static void update(int[][]seg,char[]arr,int idx, int lo , int hi , int node , char val) {
  if(lo == hi) {
  //	seg[idx] += val;
  seg[idx][val-'a']++;
  seg[idx][arr[node]-'a']--;
  
  }else {
  int mid = (lo + hi )/2;
  if(node<=mid && node>=lo) {
  update(seg,arr, idx * 2 +1, lo, mid, node, val);
  }else {
  update(seg,arr, idx*2 + 2, mid + 1, hi, node, val);
  }
  //seg[idx] = seg[idx*2 + 1] + seg[idx*2 + 2];
  for(int i = 0 ; i<27;i++) {
  	seg[idx][i] = seg[2*idx+1][i] + seg[2*idx + 2][i];
  }
  }
  
  }
  	
  	
  	
  	
  	
  	
  	public static int lower_bound(int array[], int low, int high, int key){
  	// Base Case
  	if (low > high) {
  	return low;
  	}
  
  	// Find the middle index
  	int mid = low + (high - low) / 2;
  
  	// If key is lesser than or equal to
  	// array[mid] , then search
  	// in left subarray
  	if (key <= array[mid]) {
  
  	return lower_bound(array, low,
  	            mid - 1, key);
  	}
  
  	// If key is greater than array[mid],
  	// then find in right subarray
  	return lower_bound(array, mid + 1, high,
  	        key);
  	}
  	
  	public static int upper_bound(int arr[], int low,
              int high, int key){
  // Base Case
  if (low > high || low == arr.length)
  return low;
  
  // Find the value of middle index
  int mid = low + (high - low) / 2;
  
  // If key is greater than or equal
  // to array[mid], then find in
  // right subarray
  if (key >= arr[mid]) {
  return upper_bound(arr, mid + 1, high,
                  key);
  }
  
  // If key is less than array[mid],
  // then find in left subarray
  return upper_bound(arr, low, mid - 1,
              key);
  }
  
  //	-----------------------------------------------------------------------------------------------------------------------------------------------
  	public static long gcd(long a, long b){
          if (a == 0)
              return b;
          return gcd(b % a, a);
      }
  //--------------------------------------------------------------------------------------------------------------------------------------------------------
  	public static long modInverse(long a, long m){
          long m0 = m;
          long y = 0, x = 1;
   
          if (m == 1)
              return 0;
   
          while (a > 1) {
              // q is quotient
              long q = a / m;
   
              long t = m;
   
              // m is remainder now, process
              // same as Euclid's algo
              m = a % m;
              a = t;
              t = y;
   
              // Update x and y
              y = x - q * y;
              x = t;
          }
   
          // Make x positive
          if (x < 0)
              x += m0;
   
          return x;
      }
  
  		
  
  //-----------------------------------------------------------------------------------------------------------------------------------
  
  	//segment tree
  	//for finding minimum in range 
  //	public static void build(int [] seg,int []arr,int idx, int lo , int hi) {
  //		if(lo == hi) {
  //			seg[idx] = arr[lo];
  //			return;
  //		}
  //		int mid = (lo + hi)/2;
  //	build(seg,arr,2*idx+1, lo, mid);
  //	build(seg,arr,idx*2+2, mid +1, hi);
  //	seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
  //	}
  ////for finding minimum in range 
  //public static int query(int[]seg,int idx , int lo , int hi , int l , int r) {
  //		if(lo>=l && hi<=r) {
  //			return seg[idx];
  //		}
  //	if(hi<l || lo>r) {
  //		return Integer.MAX_VALUE;
  //	}
  //	int mid = (lo + hi)/2;
  //	int left = query(seg,idx*2 +1, lo, mid, l, r);
  //	int right = query(seg,idx*2 + 2, mid + 1, hi, l, r);
  //	return Math.min(left, right);
  //}
  //	// for sum
  //
  //public static void update(int[]seg,int idx, int lo , int hi , int node , int val) {
  //	if(lo == hi) {
  //		seg[idx] += val;
  //	}else {
  //int mid = (lo + hi )/2;
  //if(node<=mid && node>=lo) {
  //	update(seg, idx * 2 +1, lo, mid, node, val);
  //}else {
  //	update(seg, idx*2 + 2, mid + 1, hi, node, val);
  //}
  //seg[idx] = seg[idx*2 + 1] + seg[idx*2 + 2];
  //
  //}
  
  //}
  //---------------------------------------------------------------------------------------------------------------------------------------
  
  
  	static void shuffleArray(int[] ar)
  	  {
  	    // If running on Java 6 or older, use `new Random()` on RHS here
  	    Random rnd = ThreadLocalRandom.current();
  	    for (int i = ar.length - 1; i > 0; i--)
  	    {
  	      int index = rnd.nextInt(i + 1);
  	      // Simple swap
  	      int a = ar[index];
  	      ar[index] = ar[i];
  	      ar[i] = a;
  	    }
  	  }
  //-----------------------------------------------------------------------------------------------------------------------------------------------------------
  
  }
  
  
  class FastReader {
      BufferedReader br;
      StringTokenizer st;
  
      public FastReader()
      {
          br = new BufferedReader(
              new InputStreamReader(System.in));
      }
  
      String next()
      {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
  
              
              
              
              
              }
              catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      int nextInt() { return Integer.parseInt(next()); }
  
      long nextLong() { return Long.parseLong(next()); }
  
      double nextDouble()
      {
          return Double.parseDouble(next());
      }
  
      String nextLine()
      {
          String str = "";
          try {
              str = br.readLine();
          }
          catch (IOException e) {
              e.printStackTrace();
          }
          return str;
      }
  }
  //------------------------------------------------------------------------------------------------------------------------------------------------------------
  class SegmentTree{
  	
  int n;
  	public SegmentTree(int[] arr,int n) {
  		this.arr = arr;
  		this.n = n;
  	}
  	int[] arr = new int[n];
  //	int n = arr.length;
  	int[] seg = new int[4*n];
  	void build(int idx, int lo , int hi) {
  		if(lo == hi) {
  			seg[idx] = arr[lo];
  			return;
  		}
  		int mid = (lo + hi)/2;
  	build(2*idx+1, lo, mid);
  	build(idx*2+2, mid +1, hi);
  	seg[idx] = Math.min(seg[2*idx+1],seg[2*idx+2]);
  	}
  	int query(int idx , int lo , int hi , int l , int r) {
  		if(lo<=l && hi>=r) {
  			return seg[idx];
  		}
  	if(hi<l || lo>r) {
  		return Integer.MAX_VALUE;
  	}
  	int mid = (lo + hi)/2;
  	int left = query(idx*2 +1, lo, mid, l, r);
  	int right = query(idx*2 + 2, mid + 1, hi, l, r);
  	return Math.min(left, right);
  	}
  	
  	
  }
  //-----------------------------------------------------------------------------------------------------------------------------------------------------------
  class coup{
  	int a , b;
  	public coup(int a , int b) {
  		this.a = a;
  		this.b = b;
  	}
  }
  
  class trip{
  	int a , b, c;
  	public trip(int a , int b, int c) {
  		this.a = a;
  		this.b = b;
  		this.c = c;
  	}
  }
  //---------------------------------------------------------------------------------------------------------------------------------------------------------------
  