#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>

#pragma GCC optimize("O3")

#define out(x) std::cout << x << ' ';
#define oute(x) std::cout << x << '\n';
#define enter std::cout << '\n';
#define debout(x) std::cout << #x << x << '\n';
#define debvout(x) std::cout << #x << " : "; for (auto i: x) std::cout << x << ' '; std::cout << '\n';
#define all(x) x.begin(), x.end()
using ll = long long;

void s1nmeee() {
    ll n, q;
    std::cin >> n >> q;
    std::vector<ll> a(n), x(q);
    ll ans = 0;
    for (ll& i : a) {
        std::cin >> i;
        ans += i;
    }
    for (ll& i : x) std::cin >> i;
    ll l = 0;
    for (ll i = 0; i < n && l < q; i++) {
        if (a[i] < 0) ans -= a[i], a[i] = x[l] - a[i], l++, ans += a[i];
    }
    if ((q - l - 1) % 2 == 0) out(ans)
    else out(ans + x[0] - *std::min_element(all(a)))
}

signed main() {
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false);
    ll TT = 1;
     std::cin >> TT;
    while (TT--) {
        s1nmeee();
        std::cout << '\n';
    }
}