#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
using ll = long long;
using vi = vector<int>;
using ii = pair<int, int>;
using vii = vector<ii>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
const int mx = 2e5;
ll a[mx];
ll mss(vector<ll> x) {
  ll ans = 0, msf = 0;
  for (ll b : x) {
    msf = max(b + msf, 0ll);
    ans = max(msf, ans);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    ll sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i & 1 ^ 1) sum += a[i];
    }
    vll b1, b2;
    for (int i = 0; i + 1 < n; i += 2) b1.push_back(a[i + 1] - a[i]);
    for (int i = 1; i + 1 < n; i += 2) b2.push_back(a[i] - a[i + 1]);
    cout << sum + max({0ll, mss(b1), mss(b2)}) << "\n";
  }
}
