#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int a[n], ar[n];
    for (int i = 0; i < n; i += 1) cin >> ar[i];
    if (n == 1) {
      cout << ar[0] << endl;
      continue;
    }
    if (n == 2) {
      cout << max(ar[0], ar[1]) << endl;
      continue;
    }
    vector<int> v0, v1;
    for (int i = 1; i < n; i += 2) v0.push_back(ar[i] - ar[i - 1]);
    for (int i = 2; i < n; i += 2) v1.push_back(ar[i - 1] - ar[i]);
    long long int tot0 = -1 * 1000000007, tot1 = -1 * 1000000007;
    long long int me = 0;
    for (int i = 0; i < v0.size(); i += 1) {
      me += v0[i];
      if (tot0 < me) {
        tot0 = me;
      }
      if (me < 0) {
        me = 0;
      }
    }
    me = 0;
    for (int i = 0; i < v1.size(); i += 1) {
      me += v1[i];
      if (tot1 < me) {
        tot1 = me;
      }
      if (me < 0) {
        me = 0;
      }
    }
    if (tot0 < 0) tot0 = 0;
    if (tot1 < 0) tot1 = 0;
    long long int ans = 0;
    for (int i = 0; i < n; i += 2) ans += ar[i];
    cout << ans + max(tot0, tot1) << endl;
  }
}
