

#include <bits/stdc++.h>

using namespace std;

const int N = 3e5 + 12;
using ll = long long;
mt19937_64 rng (time (0));
#define int long long
void solve () {
    int n, m;
    cin >> n >> m;
    vector<int> x(m);
    for (int i = 0; i < m; ++i) cin >> x[i];
    int ans = 0;
    for (int mask = 0; mask < (1 << m); ++mask) {
        int a1 = 0, a2 = 0;
        for (int i = 0; i < m; ++i) {
            if ((mask >> i) & 1) a1 = x[i] - a1;
            else a2 = x[i] - a2;
        }
        ans = max (ans, a1 + a2);
    }
}
signed main() {
//#ifdef local
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//#endif // local
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int test = 1;
    cin >> test;
    while (test--) solve();
}
