#include <bits/stdc++.h>
using namespace std;
long long MAXSUM(vector<long long> a, int n) {
  long long meh = 0;
  long long msf = INT_MIN;
  for (int i = 0; i < n; i++) {
    meh += a[i];
    if (meh < a[i]) meh = a[i];
    if (msf < meh) msf = meh;
  }
  return msf;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n;
    long long a[n + 2];
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) sum += a[i];
    }
    vector<long long> v1, v2;
    if (n % 2 == 0)
      x = n;
    else
      x = n - 1;
    for (int i = 0; i < x; i += 2) {
      v1.push_back(a[i + 1] - a[i]);
    }
    for (int i = 1; i < n; i += 2) {
      v2.push_back(a[i] - a[i + 1]);
    }
    long long sum1 = MAXSUM(v1, v1.size());
    long long sum2 = MAXSUM(v2, v2.size());
    if (max(sum1, sum2) > 0) sum += max(sum1, sum2);
    cout << sum << endl;
  }
}
