#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
using ill = int long long;
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ill t; cin >> t;
    while (t--) {
        ill n, m;
        cin >> n >> m;
        vector<ill> a(m);
        for (auto &i: a)
            cin >> i;

        ill ans = -(long long)1e18;
        for (ill b = 0; b < (1 << (m + 1)); b++) {
            vector<ill> d = {0, 0};
            ill x = b;
            for (ill j = 0; j < m; j++) {
                d[x % 2] = a[j] - d[x % 2];
                x /= 2;
            }
            ans = max(ans, d[0] + d[1]);
        }
        cout << ans << '\n';
    }
    return 0;
}