#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long MOD = (long long)(1e9 + 7);
long long int dp[N][3][2];
long long int n;
vector<long long int> v;
long long int solve(long long int index, long long int chance,
                    long long int pos) {
  if (index == n) {
    if (chance == 1) {
      if (pos != index % 2) return -INT_MAX;
    }
    return 0;
  }
  if (dp[index][chance][pos] != -1) return dp[index][chance][pos];
  long long int& ans = dp[index][chance][pos];
  ans = 0;
  if (index % 2 == 0) {
    if (chance == 0) {
      ans = max(ans, v[index] + solve(index + 1, 0, pos));
      ans = max(ans, solve(index + 1, 1, 0));
    } else if (chance == 1) {
      ans = max(ans, solve(index + 1, 1, pos));
      if (pos == 1) {
        ans = max(ans, solve(index + 1, 2, pos));
      }
    } else {
      ans = max(ans, v[index] + solve(index + 1, chance, pos));
    }
  } else {
    if (chance == 0) {
      ans = max(ans, solve(index + 1, chance, pos));
      ans = max(ans, v[index] + solve(index + 1, 1, 1));
    } else if (chance == 1) {
      ans = max(ans, v[index] + solve(index + 1, chance, pos));
      if (pos == 0) {
        ans = max(ans, v[index] + solve(index + 1, 2, pos));
      }
    } else {
      ans = max(ans, solve(index + 1, 2, pos));
    }
  }
  return ans;
}
void solve() {
  cin >> n;
  vector<long long int> vcc(n + 1);
  for (long long int i = 0; i < n; i++) {
    cin >> vcc[i];
  }
  for (long long int i = 0; i <= n; i++) {
    for (long long int j = 0; j < 3; j++) {
      for (long long int k = 0; k < 2; k++) {
        dp[i][j][k] = -1;
      }
    }
  }
  v = vcc;
  cout << solve(0, 0, 0) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) solve();
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
