#include <bits/stdc++.h>
using namespace std;
long long solveOdd(vector<long long> &a) {
  long long n = a.size();
  vector<long long> pref_raz(n + 1), suf_max(n + 10, -2e18);
  for (long long i = 1; i < n; i += 2) {
    if (i == 1)
      pref_raz[i] = a[i] - a[i - 1];
    else
      pref_raz[i] = pref_raz[i - 2] + a[i] - a[i - 1];
  }
  long long start = n - 1;
  if (start % 2 == 0) --start;
  for (long long i = start; i >= 0; i -= 2) {
    suf_max[i] = max(suf_max[i + 2], pref_raz[i]);
  }
  long long mx = -2e18;
  for (long long i = 0; i < n; i += 2) {
    if (i == n - 1) continue;
    if (i == 0) {
      mx = max(mx, suf_max[1]);
    } else {
      mx = max(mx, suf_max[i + 1] - pref_raz[i - 1]);
    }
  }
  return mx;
}
long long solveEven(vector<long long> &a) {
  long long n = a.size();
  vector<long long> pref_raz(n + 1), suf_max(n + 10, -2e18);
  for (long long i = 0; i < n; i += 2) {
    if (i == 0)
      pref_raz[i] = 0;
    else
      pref_raz[i] = pref_raz[i - 2] + a[i - 1] - a[i];
  }
  long long start = n - 1;
  if (start % 2 == 1) --start;
  for (long long i = start; i >= 0; i -= 2) {
    suf_max[i] = max(suf_max[i + 2], pref_raz[i]);
  }
  long long mx = -2e18;
  for (long long i = 1; i < n; i += 2) {
    if (i == n - 1) continue;
    if (i == 0) {
      mx = max(mx, suf_max[1]);
    } else {
      mx = max(mx, suf_max[i + 1] - pref_raz[i - 1]);
    }
  }
  return mx;
}
signed main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    long long sum = 0;
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
      if (i % 2 == 0) sum += a[i];
    }
    long long mx = solveOdd(a);
    mx = max(mx, solveEven(a));
    cout << sum + max(0LL, mx) << '\n';
  }
}
