#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define int ll

void solve() {

  int n, m; cin >> n >> m;
  int x[m]; for(int &i : x) cin >> i;
  

  int mx = 0;
  for(int mask = 0; mask < (1ll<<m); ++mask) {
    int a[2] = {0, 0};
    for(int i = 0; i < m; ++i) {
      int j = (mask>>i)&1;
      a[j] = x[i] - a[j];
    }
    mx = max(mx, a[0]+a[1]);
  }

  cout << mx << '\n';


  return;
}


signed main() {
  ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef pcms2
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
#endif
  int tt; cin >> tt; while(tt--)
  solve();

  return 0;
}