#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, t;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n);
    long long int a[n + 1], even[n + 1], odd[n + 1], sum = 0;
    long long int diff = 0, oddp, evenp;
    for (i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
      even[i] = 0;
      odd[i] = 0;
      if (i % 2 == 0) sum += a[i];
    }
    for (i = 0; i < n; i++) {
      if (i % 2) {
        odd[i] = odd[i - 1] + a[i];
        even[i] = even[i - 1];
      } else {
        if (i == 0) {
          even[i] += a[i];
          odd[i] = 0;
        } else {
          even[i] = even[i - 1] + a[i];
          odd[i] = odd[i - 1];
        }
      }
      if (i % 2) {
        long long int d = odd[i] - even[i];
        if (d > diff) diff = d;
        if (d < 0) {
          odd[i] = 0;
          even[i] = 0;
        }
      }
    }
    for (i = 0; i < n; i++) {
      odd[i] = 0;
      even[i] = 0;
    }
    for (i = 1; i < n; i++) {
      if (i % 2) {
        odd[i] = odd[i - 1] + a[i];
        even[i] = even[i - 1];
      } else {
        if (i == 0) {
          even[i] += a[i];
          odd[i] = 0;
        } else {
          even[i] = even[i - 1] + a[i];
          odd[i] = odd[i - 1];
        }
      }
      if (i % 2 == 0) {
        long long int d = odd[i] - even[i];
        if (d > diff) diff = d;
        if (d < 0) {
          odd[i] = 0;
          even[i] = 0;
        }
      }
    }
    sum += diff;
    cout << sum << endl;
  }
}
