#include <bits/stdc++.h>
using namespace std;
long long int maxSubArraySum(vector<long long int> a, long long int size) {
  long long int max_so_far = INT_MIN, max_ending_here = 0;
  for (long long 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_so_far;
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, ans = 0;
    cin >> n;
    long long int ar[n];
    vector<long long int> x, y;
    for (long long int i = 0; i < n; i++) cin >> ar[i];
    for (long long int i = 0; i < n; i++)
      if (i % 2 == 0) {
        if (i) x.push_back(-ar[i] + ar[i - 1]);
        if (i != n - 1) y.push_back(-ar[i] + ar[i + 1]);
        ans += ar[i];
      }
    ans +=
        max(0LL, max(maxSubArraySum(x, x.size()), maxSubArraySum(y, y.size())));
    cout << ans << endl;
  }
  return 0;
}
