#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18 + 100100, INF = 2e9 + 100100;
const double EPS = 1e-9, PI = acos(-1);
const long long MOD = 1e9 + 7, P = 239;
const long long MOD1 = 1e9 + 9, P1 = 117;
const long long MAXN = 1e7, MAXLOG = 21;
inline void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n), pref(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    if (i == 0) {
      pref[i] = -a[i];
    } else {
      pref[i] = pref[i - 1];
      if (i & 1) {
        pref[i] += a[i];
      } else {
        pref[i] -= a[i];
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i < n; i += 2) {
    ans += a[i];
  }
  long long saveAns = ans;
  vector<long long> last(2);
  for (long long i = 0; i < n; ++i) {
    last[i % 2] = min(last[i % 2], pref[i]);
    ans = max(ans, saveAns + pref[i] - last[i % 2]);
  }
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    solve();
  }
  return 0;
}
