#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long kadane(vector<long long> a, long long size) {
  long long ans = INT_MIN, cur = 0;
  for (long long i = 0; i < size; i++) {
    cur = cur + a[i];
    ans = max(ans, cur);
    cur = max(cur, 0LL);
  }
  return ans;
}
void solve() {
  long long n, k, m = 0, i = 0, j = 0, l, r, x, y, t = 0, p = 0;
  cin >> n;
  vector<long long> a(n, 0), b(n, 0), c(n, 0);
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (i % 2 == 0) m += a[i];
  }
  for (i = 1; i < n - 1; i += 2) b[t] = a[i] - a[i + 1], t++;
  for (i = 0; i < n - 1; i += 2) c[p] = a[i + 1] - a[i], p++;
  cout << m + max({kadane(c, p), kadane(b, t), 0LL}) << "\n";
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
}
