#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long lnf = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int N = 2e5 + 10;
const int M = 1e6 + 10;
const int mod = 1e9 + 7;
int t, n;
long long a[N];
long long dp[N][2];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    long long ans = 0, sum1 = 0, sum2 = 0, mmax = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (i & 1) ans += a[i];
    }
    for (int i = 2; i <= n; i += 2) {
      sum1 = max(0ll, a[i] - a[i - 1] + sum1);
      mmax = max(mmax, sum1);
    }
    for (int i = 3; i <= n; i += 2) {
      sum2 = max(0ll, a[i - 1] - a[i] + sum2);
      mmax = max(mmax, sum2);
    }
    ans += mmax;
    cout << ans << '\n';
  }
  return 0;
}
