#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& os, pair<A, B> p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class A>
ostream& operator<<(ostream& os, vector<A> v) {
  os << "{ ";
  for (auto& x : v) cout << x << " ";
  return os << "}";
}
template <class A>
ostream& operator<<(ostream& os, vector<vector<A>> v) {
  os << "{ " << v.front() << '\n';
  for (auto it = next(v.begin()); it != v.end(); it++)
    os << "  " << *it << '\n';
  return os << "}";
}
using VI = vector<int>;
using VVI = vector<VI>;
using II = pair<int, int>;
using VII = vector<II>;
using L = long long;
using VL = vector<L>;
using VB = vector<bool>;
using VVB = vector<VB>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  for (decltype((t)-1) task = (0), task__ = ((t)-1); task <= task__; task++) {
    int n;
    cin >> n;
    VL in(n);
    for (decltype((n)-1) i = (0), i__ = ((n)-1); i <= i__; i++) cin >> in[i];
    L min_pref_even = 2e9;
    L min_pref_odd = 0;
    L pref = 0;
    L sum_even = 0;
    L ans = 0;
    for (decltype((n)-1) i = (0), i__ = ((n)-1); i <= i__; i++) {
      if (i & 1) {
        pref += in[i];
        min_pref_odd = min(min_pref_odd, pref);
        ;
        ans = max(ans, pref - min_pref_odd);
      } else {
        pref -= in[i];
        sum_even += in[i];
        min_pref_even = min(min_pref_even, pref);
        ;
        ans = max(ans, pref - min_pref_even);
      };
    }
    cout << sum_even + ans << "\n";
  }
  return 0;
}
