#include <bits/stdc++.h>
using namespace std;
long long d1[4] = {1, -1, 0, 0};
long long d2[4] = {0, 0, 1, -1};
int main() {
  long long T;
  cin >> T;
  for (long long test = (0); test < (long long)(T); test++) {
    long long n;
    cin >> n;
    vector<long long> a(n), d(n / 2);
    long long org = 0;
    for (long long i = (0); i < (long long)(n); i++) {
      cin >> a[i];
      if (i % 2 == 0) org += a[i];
    }
    for (long long i = (0); i < (long long)(n / 2); i++) {
      d[i] = a[2 * i + 1] - a[2 * i];
    }
    long long ans = -1, s = 0;
    for (long long i = (0); i < (long long)(n / 2); i++) {
      s = max(s + d[i], d[i]);
      ans = max(ans, s);
    }
    if (n % 2 == 0) {
      for (long long i = (0); i < (long long)(n / 2 - 1); i++) {
        d[i] = a[2 * i + 1] - a[2 * i + 2];
      }
      long long ans2 = 0, s2 = 0;
      for (long long i = (0); i < (long long)(n / 2 - 1); i++) {
        s2 = max(s2 + d[i], d[i]);
        ans2 = max(ans2, s2);
      }
      ans = max(ans, ans2);
      cout << org + max(0LL, ans) << endl;
    } else {
      for (long long i = (0); i < (long long)(n / 2); i++) {
        d[i] = a[2 * i + 1] - a[2 * i + 2];
      }
      long long ans2 = 0, s2 = 0;
      for (long long i = (0); i < (long long)(n / 2); i++) {
        s2 = max(s2 + d[i], d[i]);
        ans2 = max(ans2, s2);
      }
      ans = max(ans, ans2);
      cout << org + max(0LL, ans) << endl;
    }
  }
  return 0;
}
