#include<bits/stdc++.h>
#define int long long
using namespace std;

void solve() {
    int n, m, s = 0, ans = 0;
    cin >> n >> m;
    vector<int> x(m);
    for (int i = 0; i < m; i++) cin >> x[i];
    if (n >= m) {
        for (int i = 0; i < m; i++) {
            s += x[i];
        }
        cout << s;
        return;
    }
    for (int mask = 0; mask < (1<<m); mask++) {
        int v1 = 0, v2 = 0;
        for (int i = 0; i < m; i++) {
            if (mask&(1<<m)) {
                v2 = x[i] - v2;
            }
            else {
                v1 = x[i] - v1;
            }
        }
        ans = max(ans, v1 + v2);
    }
    cout << ans;
}

int32_t main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int tt;
    cin >> tt;
    while (tt--) {
        solve();
        cout << '\n';
    }
}
