#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int T;
  cin >> T;
  for (int tc = 1; tc <= T; tc++) {
    int n;
    cin >> n;
    vector<long long int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    long long int second = 0;
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) second += v[i];
    }
    long long int mx = 0;
    {
      long long int cur = 0;
      for (int i = 0; i < n; i++) {
        if (i % 2 == 0) {
          cur -= v[i];
        } else {
          cur += v[i];
          mx = max(mx, cur);
          if (cur < 0) cur = 0;
        }
      }
    }
    {
      long long int cur = 0;
      for (int i = n - 1; i >= 0; i--) {
        if (i % 2 == 0) {
          cur -= v[i];
        } else {
          if (i == n - 1) continue;
          cur += v[i];
          mx = max(mx, cur);
          if (cur < 0) cur = 0;
        }
      }
    }
    cout << second + mx << "\n";
  }
}
