#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &x : a) cin >> x;
    long long curmax = 0;
    long long cur = 0;
    int l, r;
    l = r = 0;
    int lmax = -1, rmax = -1;
    for (int i = 0; i < n - 1; i += 2) {
      int d = a[i + 1] - a[i];
      cur += d;
      if (cur < 0) {
        cur = 0;
        l = i + 2;
        r = i + 2;
        continue;
      }
      r = i + 1;
      if (cur > curmax) {
        lmax = l;
        rmax = r;
        curmax = cur;
      }
    }
    l = 1, r = 1;
    cur = 0;
    for (int i = 1; i < n - 1; i += 2) {
      int d = a[i] - a[i + 1];
      cur += d;
      if (cur < 0) {
        cur = 0;
        l = i + 2;
        r = i + 2;
        continue;
      }
      r = i + 1;
      if (cur > curmax) {
        lmax = l;
        rmax = r;
        curmax = cur;
      }
    }
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      if (lmax <= i && i <= rmax) {
        if (i & 1) ans += a[i];
      } else if (i % 2 == 0) {
        ans += a[i];
      }
    }
    cout << ans << endl;
  }
}
