#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n + 1];
    long long e_sum = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) e_sum += a[i];
    }
    long long max_diff_sum = 0;
    long long pref_sum = 0;
    for (long long i = 1; i < n; i = i + 2) {
      pref_sum = max(pref_sum + a[i] - a[i - 1], 0ll);
      max_diff_sum = max(max_diff_sum, pref_sum);
    }
    pref_sum = 0;
    for (long long i = 1; i < n - 1; i = i + 2) {
      pref_sum = max(pref_sum + a[i] - a[i + 1], 0ll);
      max_diff_sum = max(max_diff_sum, pref_sum);
    }
    cout << e_sum + max_diff_sum << "\n";
  }
  return 0;
}
