#include <bits/stdc++.h>
using namespace std;
long long a[200002], sum;
long long v1[200002], v2[200002];
int main() {
  long long n, q;
  cin >> q;
  for (int t = 1; t <= q; t++) {
    cin >> n;
    sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) sum += a[i];
    }
    for (int i = 0; 2 * i + 1 < n; i++) v1[i] = a[2 * i + 1] - a[2 * i];
    for (int i = 0; 2 * i + 2 < n; i++) v2[i] = a[2 * i + 1] - a[2 * i + 2];
    long long best1 = 0, rez1 = 0, best2 = 0, rez2 = 0;
    for (int i = 0; 2 * i + 1 < n; i++) {
      best1 = max(v1[i], best1 + v1[i]);
      rez1 = max(best1, rez1);
    }
    for (int i = 0; 2 * i + 2 < n; i++) {
      best2 = max(v2[i], best2 + v2[i]);
      rez2 = max(best2, rez2);
    }
    cout << sum + max(rez1, rez2) << '\n';
  }
  return 0;
}
