//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#pragma GCC target("avx2")
using namespace std;
using ll = int64_t;

void solve() {
    ll n, m;
    cin >> n >> m;
    vector<ll> a(n, 0), x(m);
    for (auto &i : x) {
        cin >> i;
    }
    ll ans = -1e18;
    for (ll mask = 0; mask < (1 << m); ++mask) {
        a[0] = 0;
        a[1] = 0;
        for (ll i = 0; i < m; ++i) {
            ll ind = (mask & (1 << i)) != 0;
            a[ind] = x[i] - a[ind];
        }
        ans = max(ans, a[0] + a[1]);
    }
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t = 1;
    cin >> t;
    while (t --> 0) {
        solve();
    }

    return 0;
}
