#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long a[N], dp[N][3][2], n;
long long solve(int i, int stage, int one) {
  if (i == n) return (stage == 1) * -1e15;
  long long &ret = dp[i][stage][one];
  if (~ret) return ret;
  ret = 0;
  if (stage == 0) {
    ret = !(i & 1) * a[i] + solve(i + 1, stage, one);
    ret = max(ret, (i & 1) * a[i] + solve(i + 1, 1, i % 2));
  } else if (stage == 1) {
    ret = (i & 1) * a[i] + solve(i + 1, stage, one);
    if (one != (i & 1)) ret = max(ret, (i & 1) * a[i] + solve(i + 1, 2, i % 2));
  } else {
    ret = !(i & 1) * a[i] + solve(i + 1, stage, one);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < 3; j++)
        for (int k = 0; k < 2; k++) dp[i][j][k] = -1;
    cout << solve(0, 0, 0) << "\n";
  }
  return 0;
}
