#include <bits/stdc++.h>

#define int long long
using namespace std;

const int INF = 2e16;
vector<int> arr;
vector<int> used;
int ans = 0;

void rec(int i) {
    // cout << used[0] << " " << used[1] << "\n";
    if (i == arr.size()) {
        int sm = used[0] + used[1];
        ans = max(ans, sm);
        return;
    }
    int p = used[0];
    used[0] = arr[i] - used[0];
    rec(i + 1);
    used[0] = p;
    int p1 = used[1];
    used[1] = arr[i] - used[1];
    rec(i + 1);
    used[1] = p;
}

signed main() {
    int tt;
    cin >> tt;
    while (tt--) {
        int n, m;
        cin >> n >> m;
        arr.assign(m, 0);
        used.assign(2, 0);
        for (int i = 0; i < m; i++) {
            cin >> arr[i];
        }
        ans = 0;
        rec(0);
        cout << ans;
    }
}