#include <bits/stdc++.h>
using namespace std;
long long mx(vector<long long> &a, int size) {
  long long max_so_far = INT_MIN, max_ending_here = 0;
  for (int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max(0LL, max_so_far);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long n, i, j, ans = 0;
    cin >> n;
    long long a[n];
    vector<long long> v1, v2;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) ans += a[i];
    }
    for (i = 1; i < n - 1; i += 2) {
      v1.push_back(a[i] - a[i - 1]);
      v2.push_back(a[i] - a[i + 1]);
    }
    if (n % 2 == 0) v1.push_back(a[n - 1] - a[n - 2]);
    ans += max(mx(v1, v1.size()), mx(v2, v2.size()));
    cout << ans << '\n';
  }
  return 0;
}
