#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, i, ans = 0, sum = 0;
    vector<long long int> v;
    cin >> n;
    long long int a[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) sum += a[i];
    }
    for (i = 1; i < n; i += 2) {
      v.push_back(a[i] - a[i - 1]);
    }
    long long int max_so_far = 0, max_ending_here = 0;
    for (i = 0; i < v.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;
    }
    ans = max_so_far;
    v.clear();
    for (i = 2; i < n; i += 2) {
      v.push_back(a[i - 1] - a[i]);
    }
    max_so_far = 0, max_ending_here = 0;
    for (i = 0; i < v.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;
    }
    ans = max(ans, max_so_far);
    cout << sum + ans << "\n";
  }
  return 0;
}
