#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

//template<typename T>
//using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define rs resize
#define pb push_back
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define int long long

typedef long double ld;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template<typename T>
istream &operator >>(istream &in, pair<T, T> &a) {
    in >> a.ff >> a.ss;
    return in;
}

template<typename T>
ostream &operator <<(ostream &out, pair<T, T> &a) {
    out << a.ff << " " << a.ss;
    return out;
}

template<typename T>
istream &operator >>(istream &in, vector<T> &a) {
    for (auto &i : a) in >> i;
    return in;
}

template<typename T>
ostream &operator <<(ostream &out, vector<T> &a) {
    for (auto i : a) cout << i << " ";
    return out;
}


void solve() {
    int n, m; cin >> m >> n;
    vector<int> s(n); cin >> s;

    int ans = 0;
    for (int msk = 0; msk < (1 << n); msk++) {
        int a = 0, b = 0;
        for (int i = 0; i < n; i++) {
            if ((msk >> i) & 1) {
                a = s[i] - a;
            } else {
                b = s[i] - b;
            }
        }
        ans = max(ans, a + b);
    }
    cout << ans << "\n";
}

int32_t main() {
#ifndef LOCAL
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#endif
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    double tim = clock();
#endif

    int tests = 1;
    cin >> tests;
    while (tests--) {
        solve();
#ifdef LOCAL
        cout << "-------------------\n";
#endif
    }

#ifdef LOCAL
    cout << (double)(clock() - tim) / CLOCKS_PER_SEC;
#endif
}
