#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[30], b[30], n, k, testcase;
  cin >> testcase;
  while (testcase-- > 0) {
    cin >> n >> k;
    long long int total = 0, res;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      total += a[i];
    }
    for (int i = 0; i < n; i++) {
      cin >> b[i];
    }
    sort(a, a + n);
    sort(b, b + n);
    res = total;
    for (int i = 0; i < k; i++) {
      total = total - a[i] + b[n - i - 1];
      res = max(total, res);
    }
    cout << res << endl;
  }
  return 0;
}
