
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>

using namespace std;

#define ll long long
#define FOR(i, s, f) for(ll (i) = (s); (i) < (f); (i)++)
const long long INF = 1e18;

void solve(){
    ll n, m;
    cin >> n >> m;
    vector<ll> arr(m);
    FOR(i, 0, m) cin >> arr[i];
    ll a = 0;
    ll ans = -INF;
    while(a < pow(2, m)){
        ll t = a;
        ll p1 = 0, p2 = 0;
        FOR(i, 0, m){
            if (t % 2 == 0){
                p1 = arr[i] - p1;
            }
            else p2 = arr[i] - p2;
            t /= 2;
        }
        if (p1 + p2 > ans) {ans = p1 + p2;}
        a++;
    }
    cout << ans;

}

int main() {
    cout.precision(32);
    ll t = 1;
    cin >> t;
    while(t--){
        solve();
    }
    return 0;
}
