#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
// #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define int long long
// #define ll __int128
using namespace std;
// using namespace __gnu_pbds;
// #define unordered_map gp_hash_table
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

const int INF = 1e13 + 7;

int x[30];

void solve() {
    int n, m;
    cin >> n >> m;
    int res = -INF;
    for (int i = 0; i < m; i++) {
        cin >> x[i];
    }
    int b[2];
    for (int mask = 0; mask < (1 << m); mask++) {
        b[0] = b[1] = 0;
        for (int i = 0; i < m; i++) {
            int z = (mask >> i) & 1;
            b[z] = x[i] - b[z];
        }
        res = max(res, b[0] + b[1]);
    }
    cout << res << "\n";
}

signed main() {
    // cout << fixed << setprecision(20);
    #ifdef LOCAL
    freopen("C:\\work\\input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    #endif
    int t;
    cin >> t;
    while (t--)
    solve();
}