#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long int mxsum(vector<long long int> &a) {
  long long int n = a.size();
  long long int mx = 0, s = 0;
  for (long long int i = 0; i < n; i++) {
    s += a[i];
    if (s < 0) s = 0;
    mx = max(mx, s);
  }
  return mx;
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (auto &x : a) cin >> x;
  vector<long long int> v1, v2;
  long long int sum = 0;
  for (long long int i = 0; i < n; i += 2) sum += a[i];
  for (long long int i = 0; i + 1 < n; i += 2) v1.push_back(a[i + 1] - a[i]);
  for (long long int i = 1; i + 1 < n; i += 2) v2.push_back(a[i] - a[i + 1]);
  long long int ans = sum + max(mxsum(v1), mxsum(v2));
  cout << ans << endl;
}
void debug(long long int tt) {}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
}
