#include <bits/stdc++.h>
using namespace std;
long long denom = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= denom;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % denom;
    a = a * a % denom;
  }
  return res;
}
long long maxSub(vector<long long>& v) {
  long long mn = 0;
  long long sum = 0;
  long long result = 0;
  for (long long i = (0); i < (v.size()); i++) {
    sum += v[i];
    result = max(result, sum - mn);
    mn = min(mn, sum);
  }
  return result;
}
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  for (long long i = (0); i < (t); i++) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long j = (0); j < (n); j++) cin >> a[j];
    long long sum = 0;
    for (long long j = (0); j < (n); j++) sum += j % 2 == 0 ? a[j] : 0;
    vector<long long> v1;
    for (long long j = 1; j < n; j += 2) v1.push_back(a[j] - a[j - 1]);
    vector<long long> v2;
    for (long long j = 1; j < n - 1; j += 2) v2.push_back(a[j] - a[j + 1]);
    long long delta = max(maxSub(v1), maxSub(v2));
    sum += delta;
    cout << sum << endl;
  }
  return 0;
}
