#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
const ll LINF = 1e18 + 5;
constexpr int mod = 1e9 + 7;
int n, a[N];
ll dp[N][2];
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  ll sum = 0, ext = 0;
  for (int i = 0; i < n; i += 2) sum += a[i];
  for (int i = 0; i + 1 < n; i++) {
    if (i & 1) {
      dp[i][1] = a[i] - a[i + 1];
      if (i >= 2 && dp[i - 2][1] > 0) dp[i][1] += dp[i - 2][1];
      ext = max(ext, dp[i][1]);
    } else {
      dp[i][0] = a[i + 1] - a[i];
      if (i >= 2 && dp[i - 2][0] > 0) dp[i][0] += dp[i - 2][0];
      ext = max(ext, dp[i][0]);
    }
  }
  cout << sum + ext << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int _;
  cin >> _;
  while (_--) solve();
  return 0;
}
