#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#define int long long

using namespace std;

const int INF = 2e15;

void solve() {
	int n, m;
	cin >> n >> m;
	vector <int> arr(n, 0), brr(m);
	for (int i = 0; i < m; i++) {
		cin >> brr[i];
	}
	int ans = -INF;
	for (int mask = 0; mask < (1ll << m); mask++) {
		int a = 0, b = 0;
		for (int i = 0; i < m; i++) {
			if ((mask >> i) & 1) {
				b = brr[i] - b;
			}
			else {
				a = brr[i] - a;
			}
		}
		ans = max(ans, a + b);
	}
	cout << ans << '\n';
}

signed main() {
	int t;
	cin >> t;
	while (t--) {
		solve();
	}
}
