#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  for (; b; a %= b, swap(a, b))
    ;
  return a;
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); };
int dr[] = {0, 1, 0, -1, 1, 1, -1, -1};
int dc[] = {1, 0, -1, 0, 1, -1, 1, -1};
int n, m, k, t;
int a[200001];
int main() {
  ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n;
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) ans += a[i];
    }
    long long mx = 0;
    long long tmp = 0;
    for (int i = 0; i < n / 2 * 2; i += 2) {
      tmp -= a[i];
      tmp += a[i + 1];
      if (tmp < 0) {
        tmp = 0;
      } else {
        mx = max(mx, tmp);
      }
    }
    tmp = 0;
    for (int i = 1; i < n - 1; i += 2) {
      tmp += a[i];
      tmp -= a[i + 1];
      if (tmp < 0) {
        tmp = 0;
      } else {
        mx = max(mx, tmp);
      }
    }
    cout << ans + mx << '\n';
  }
  return 0;
}
