#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846;
long long MOD = 1e9 + 7;
const char nl = '\n';
const long long inf = 1e15;
long long mul(long long x, long long y) {
  return (1ll * (x % MOD) * (y % MOD));
}
long long modpow(long long x, long long y) {
  long long z = 1;
  while (y > 0) {
    if (y % 2) z = mul(z, x);
    x = mul(x, x);
    y /= 2;
  }
  return z;
}
long long power(long long x, long long y) {
  long long z = 1;
  while (y > 0) {
    if (y % 2) z = z * x;
    x = x * x;
    y /= 2;
  }
  return z;
}
long long gcd(long long a, long long b) {
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long sq(long long a) {
  long long ans = (1ll * a * a);
  return ans;
}
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (i % 2)
      a[i] *= (-1);
    else
      ans += a[i];
  }
  vector<long long> e;
  for (long long i = 0; i < n - 1; i += 2) {
    e.push_back(-a[i] - a[i + 1]);
  }
  long long mx = 0;
  long long l1 = (long long)(e.size());
  long long csum = 0;
  for (long long i = 0; i < l1; i++) {
    csum = max(csum + e[i], e[i]);
    mx = max(mx, csum);
  }
  vector<long long> o;
  for (long long i = 1; i < n - 1; i += 2) {
    o.push_back(-a[i] - a[i + 1]);
  }
  long long l2 = (long long)(o.size());
  csum = 0;
  for (long long i = 0; i < l2; i++) {
    csum = max(csum + o[i], o[i]);
    mx = max(mx, csum);
  }
  cout << ans + mx << nl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
