#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    cin >> n;
    long long q = 0, p = 0, s1 = 0, s2 = 0, res = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i % 2 == 0) {
        res += a[i];
      }
    }
    for (int i = 0; i < n - 1; i = i + 2) {
      p += a[i + 1] - a[i];
      p = max((long long)0, p);
      s1 = max(s1, p);
    }
    for (int i = 1; i < n - 1; i = i + 2) {
      q += a[i] - a[i + 1];
      q = max((long long)0, q);
      s2 = max(s2, q);
    }
    res += max(s1, s2);
    cout << res << endl;
  }
  return 0;
}
