#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
using ill = 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 = 0;
        for (ill b = 0; b < (1 << m); b++) {
            vector<ill> d = {0, 0};
            for (ill j = 0; j < m; j++) {
                ill x = b && (1 << j);
                d[x] = a[j] - d[x];
            }
            ans = max(ans, d[0] + d[1]);
        }
        cout << ans << endl;
    }
    return 0;
}