#include <bits/stdc++.h>
using namespace std;
int power(long long x, long long y) {
  if (y == 0) return 1;
  long long p = power(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
const long long N = (long long)(1e5 + 1);
const long long N2 = (long long)(1e6 + 1);
const long long MOD = (long long)(1e9 + 7);
const long long INF = (long long)(2e18);
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long sum = 0;
  long long b[n];
  long long c[n];
  for (long long i = 0; i < n; i++) {
    b[i] = 0;
    c[i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 0) {
      sum += a[i];
    }
    long long x = a[i + 1] - a[i];
    i++;
    b[i] = x;
  }
  long long until = b[0];
  long long curmax = b[0];
  for (long long i = 1; i < n; i++) {
    curmax = max(b[i], curmax + b[i]);
    until = max(until, curmax);
  }
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 1) {
      long long y = a[i] - a[i + 1];
      c[i + 1] = y;
    }
  }
  long long until2 = c[0];
  long long curmax2 = c[0];
  for (long long i = 1; i < n; i++) {
    curmax2 = max(c[i], curmax2 + c[i]);
    until2 = max(until2, curmax2);
  }
  cout << max(until, until2) + sum << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
