#include <bits/stdc++.h>
using namespace std;
const int MX = 500005;
const long long MOD = 1000000007;
void setIO(string name) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  freopen((name + ".in").c_str(), "r", stdin);
  freopen((name + ".out").c_str(), "w", stdout);
}
int t;
int n;
void solve() {
  cin >> n;
  long long x = 0, even = 0, odd = 0;
  long long sum = 0, improv = 0;
  for (int i = 0; i < (n); i++) {
    int a;
    cin >> a;
    if (i % 2 == 0) {
      x -= a;
      improv = max(improv, x - even);
      even = min(x, even);
      sum += a;
    }
    if (i % 2 == 1) {
      x += a;
      improv = max(improv, x - odd);
      odd = min(x, odd);
    }
  }
  cout << sum + improv << endl;
}
int main() {
  cin >> t;
  for (int i = 0; i < (t); i++) {
    solve();
  }
}
