#include <bits/stdc++.h>
using namespace std;
long long int kadane(vector<long int> v) {
  long long int max_so_far = 0, max_ending_here = 0;
  int size = v.size();
  for (int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + v[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_so_far;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<long int> v1, v2;
    long long int sum = 0;
    for (int i = 0; i < n; i += 2) sum += a[i];
    for (int i = 0; i < n - 1; i += 2) {
      v1.push_back(a[i + 1] - a[i]);
    }
    for (int i = 1; i < n - 1; i += 2) {
      v2.push_back(a[i] - a[i + 1]);
    }
    long long int x = kadane(v1);
    long long int y = kadane(v2);
    cout << sum + max(x, y) << endl;
  }
}
