#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& is, vector<T>& a) {
  for (T& ai : a) is >> ai;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> const& a) {
  os << "[ ";
  for (const T& ai : a) os << ai << " ";
  return os << "]";
}
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& a) {
  return is >> a.first >> a.second;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> const& a) {
  return os << "(" << a.first << ", " << a.second << ")";
}
long long f() {
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  long long r = 0, s = 0;
  vector<long long> lo(2);
  for (int i = 0; i < n; ++i) {
    int p = i & 1;
    s += (2 * p - 1) * a[i];
    lo[p] = min(lo[p], s);
    r = max(r, s - lo[p]);
  }
  for (int i = 0; i < n; i += 2) r += a[i];
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) cout << f() << "\n";
  return 0;
}
