#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    long long int sum = 0;
    for (long long int i = 0; i < n; i = i + 2) sum += a[i];
    long long int left[n / 2], right[n / 2];
    long long int p = 0, q = 0;
    for (long long int i = 1; i < n; i += 2) {
      long long int l = a[i] - a[i - 1];
      if (p == 0) {
        left[p] = l;
      } else {
        if (left[p - 1] > 0)
          left[p] = left[p - 1] + l;
        else
          left[p] = l;
      }
      p++;
      long long int r;
      if (i + 1 == n)
        r = 0;
      else
        r = a[i] - a[i + 1];
      if (q == 0)
        right[q] = r;
      else {
        if (right[q - 1] > 0)
          right[q] = right[q - 1] + r;
        else
          right[q] = r;
      }
      q++;
    }
    long long int maxc = 0;
    for (long long int i = 0; i < n / 2; i++)
      maxc = max({maxc, left[i], right[i]});
    cout << sum + maxc << endl;
  }
  return 0;
}
