#include <bits/stdc++.h>

using namespace std;

void solve() {
    int n, m;
    cin >> n >> m;
    vector<int> x(m);
    for (int i = 0; i < m; ++i) {
        cin >> x[i];
    }
    vector<int> a(2);
    int mx = -1e9;
    for (int mask = 0; mask < (1 << m); ++mask) {
        a[0] = 0;
        a[1] = 0;
        for (int j = 0; j < m; ++j) {
            a[(mask >> j) & 1] = x[j] - a[(mask >> j) & 1];
        }
        mx = max(mx, a[0] + a[1]);
    }

    cout << mx;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tt = 1;
    cin >> tt;
    for (int i = 0; i < tt; ++i) {
        solve();
        cout << '\n';
    }
}