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.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Comparator;
  import java.util.HashMap;
  import java.util.LinkedHashMap;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  import java.util.StringTokenizer;
  
  public class P1618D {
  	static PrintWriter out = new PrintWriter(System.out);
  	static MyFastReaderP1618D in = new MyFastReaderP1618D();
  	static long mod = (long) (1e9 + 7);
  
  	public static void main(String[] args) throws Exception {
  		int test = i();
  		while (test-- > 0) {
  
  			int n = i();
  			int k = i();
  			int[] arr = arrI(n);
  			long sum = 0;
  			sort(arr);
  
  			for (int i = 0; i < n - 2 * k; i++)
  				sum += arr[i];
  
  			int i=n-2*k;
  			int cnt=(n-i)/2;
  			while(cnt-->0) {
  				sum += arr[i] / arr[i + k];
                  i+=1;
  			}
  				
  			out.print(sum);
  			out.print("\n");
  			out.flush();
  		}
  		out.close();
  	}
  
  	static class pair {
  		long x, y;
  
  		pair(long ar, long ar2) {
  			x = ar;
  			y = ar2;
  		}
  	}
  
  	static void sort(long[] a) // check for long
  	{
  		ArrayList<Long> l = new ArrayList<>();
  		for (long i : a)
  			l.add(i);
  		Collections.sort(l);
  		for (int i = 0; i < a.length; i++)
  			a[i] = l.get(i);
  	}
  
  	static void sort(int[] a) {
  		ArrayList<Integer> l = new ArrayList<>();
  		for (int i : a)
  			l.add(i);
  		Collections.sort(l);
  		for (int i = 0; i < a.length; i++)
  			a[i] = l.get(i);
  	}
  
  	public static int gcd(int a, int b) {
  		if (a == 0)
  			return b;
  		return gcd(b % a, a);
  	}
  
  	static class DescendingComparator implements Comparator<Integer> {
  		public int compare(Integer a, Integer b) {
  			return b - a;
  		}
  	}
  
  	static class AscendingComparator implements Comparator<Integer> {
  		public int compare(Integer a, Integer b) {
  			return a - b;
  		}
  	}
  
  	static boolean isPalindrome(char X[]) {
  		int l = 0, r = X.length - 1;
  		while (l <= r) {
  			if (X[l] != X[r])
  				return false;
  			l++;
  			r--;
  		}
  		return true;
  	}
  
  	static long fact(long N) {
  		long num = 1L;
  		while (N >= 1) {
  			num = ((num % mod) * (N % mod)) % mod;
  			N--;
  		}
  		return num;
  	}
  
  	static long pow(long a, long b) {
  		long mod = 1000000007;
  		long pow = 1;
  		long x = a;
  		while (b != 0) {
  			if ((b & 1) != 0)
  				pow = (pow * x) % mod;
  			x = (x * x) % mod;
  			b /= 2;
  		}
  		return pow;
  	}
  
  	static long toggleBits(long x)// one's complement || Toggle bits
  	{
  		int n = (int) (Math.floor(Math.log(x) / Math.log(2))) + 1;
  
  		return ((1 << n) - 1) ^ x;
  	}
  
  	static int countBits(long a) {
  		return (int) (Math.log(a) / Math.log(2) + 1);
  	}
  
  	static boolean isPrime(long N) {
  		if (N <= 1)
  			return false;
  		if (N <= 3)
  			return true;
  		if (N % 2 == 0 || N % 3 == 0)
  			return false;
  		for (int i = 5; i * i <= N; i = i + 6)
  			if (N % i == 0 || N % (i + 2) == 0)
  				return false;
  		return true;
  	}
  
  	static long GCD(long a, long b) {
  		if (b == 0) {
  			return a;
  		} else
  			return GCD(b, a % b);
  	}
  
  	// Debugging Functions Starts
  
  	static void print(char A[]) {
  		for (char c : A)
  			System.out.print(c + " ");
  		System.out.println();
  	}
  
  	static void print(boolean A[]) {
  		for (boolean c : A)
  			System.out.print(c + " ");
  		System.out.println();
  	}
  
  	static void print(int A[]) {
  		for (int a : A)
  			System.out.print(a + " ");
  		System.out.println();
  	}
  
  	static void print(long A[]) {
  		for (long i : A)
  			System.out.print(i + " ");
  		System.out.println();
  
  	}
  
  	static void print(ArrayList<Integer> A) {
  		for (int a : A)
  			System.out.print(a + " ");
  		System.out.println();
  	}
  
  	// Debugging Functions END
  	// ----------------------
  	// IO FUNCTIONS STARTS
  	static HashMap<Integer, Integer> getHashMap(int A[]) {
  		HashMap<Integer, Integer> mp = new HashMap<>();
  		for (int a : A) {
  			int f = mp.getOrDefault(a, 0) + 1;
  			mp.put(a, f);
  		}
  		return mp;
  	}
  
  	public static Map<Character, Integer> mapSortByValue(Map<Character, Integer> hm) {
  		// Create a list from elements of HashMap
  		List<Map.Entry<Character, Integer>> list = new LinkedList<Map.Entry<Character, Integer>>(hm.entrySet());
  
  		// Sort the list
  		Collections.sort(list, new Comparator<Map.Entry<Character, Integer>>() {
  			public int compare(Map.Entry<Character, Integer> o1, Map.Entry<Character, Integer> o2) {
  				return o1.getValue() - o2.getValue();
  			}
  		});
  
  		// put data from sorted list to hashmap
  		Map<Character, Integer> temp = new LinkedHashMap<Character, Integer>();
  		for (Map.Entry<Character, Integer> aa : list) {
  			temp.put(aa.getKey(), aa.getValue());
  		}
  		return temp;
  	}
  
  	static String string() {
  		return in.nextLine();
  	}
  
  	static int i() {
  		return in.nextInt();
  	}
  
  	static long l() {
  		return in.nextLong();
  	}
  
  	static int[] arrI(int N) {
  		int A[] = new int[N];
  		for (int i = 0; i < N; i++) {
  			A[i] = in.nextInt();
  		}
  		return A;
  	}
  
  	static long[] arrL(int N) {
  		long A[] = new long[N];
  		for (int i = 0; i < A.length; i++)
  			A[i] = in.nextLong();
  		return A;
  	}
  
  }
  
  class MyFastReaderP1618D {
  	BufferedReader br;
  	StringTokenizer st;
  
  	public MyFastReaderP1618D() {
  		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;
  	}
  }
  