#include <bits/stdc++.h>
using namespace std;
int64_t n, k, m, p, ans, r[200005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int64_t t;
  cin >> t;
  while (t--) {
    cin >> n;
    m = 0;
    ans = 0;
    for (int i = 0; i <= n - 1; i++) {
      cin >> r[i];
      if (i % 2 == 0) ans += r[i];
    }
    p = 0;
    for (int i = 0; i < n - n % 2; i += 2) {
      p += r[i + 1];
      p -= r[i];
      if (p < 0) {
        p = 0;
      } else {
        m = max(p, m);
      }
    }
    p = 0;
    int64_t o = n;
    if (o % 2 == 0) o--;
    for (int i = 1; i < o; i += 2) {
      p -= r[i + 1];
      p += r[i];
      if (p < 0) {
        p = 0;
      } else {
        m = max(p, m);
      }
    }
    cout << m + ans << endl;
  }
  return 0;
}
