#include <bits/stdc++.h>
using namespace std;
vector<long long int> v, v2;
void solve(long long int n, long long int k) {}
long long int p = 0, jj = 0;
long long int maxi(vector<long long int> &v) {
  long long int start = 0, end = 0, an = -1;
  p = 0;
  for (long long int i = 0; i < v.size(); i++) {
    start += v[i];
    if (start <= 0)
      start = 0, p = i + 1;
    else {
      if (end <= start) {
        end = start;
        an = i;
        jj = p;
      }
    }
  }
  return an + 1;
}
int32_t main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    v.clear();
    v2.clear();
    for (long long int i = 0; i < n; i++) cin >> a[i];
    for (long long int i = 0; i < n; i++) {
      if (i != n - 1 and i % 2 == 0) {
        v.push_back(a[i + 1] - a[i]);
      } else if (i != n - 1 and i % 2 != 0)
        v2.push_back(a[i] - a[i + 1]);
    }
    long long int g = maxi(v);
    long long int sum = 0;
    for (long long int i = 0; i < n; i++) {
      if (2 * jj <= i and 2 * g > i) {
        if (i % 2 != 0) sum += a[i];
      } else {
        if (i % 2 == 0) sum += a[i];
      }
    }
    long long int sy = 0;
    long long int el = maxi(v2);
    for (long long int i = 0; i < n; i++) {
      if (2 * jj < i and 2 * el >= i) {
        if (i % 2 != 0) sy += a[i];
      } else {
        if (i % 2 == 0) sy += a[i];
      }
    }
    cout << max(sum, sy) << '\n';
  }
}
