#include <bits/stdc++.h>
using namespace std;
int a[1000005], b[1000005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long ans = 0, sum = 0, mx = 0;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
      if (i % 2 == 0) ans += a[i];
    }
    for (int i = 0; i < n - 1; i += 2) {
      sum += a[i + 1] - a[i];
      mx = max(mx, sum);
      if (sum < 0) sum = 0;
    }
    sum = 0;
    for (int i = 1; i < n - 1; i += 2) {
      sum += a[i] - a[i + 1];
      mx = max(mx, sum);
      if (sum < 0) sum = 0;
    }
    cout << ans + mx << endl;
  }
}
