#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long power(long long x, long long p) {
  if (p == 0) return 1;
  if (p == 1) return x;
  if (p % 2) return x * power(x, p - 1);
  long long y = power(x, p / 2);
  return y * y;
}
void solve() {
  long long n;
  cin >> n;
  long long arr[n], res = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i % 2 == 0) res += arr[i];
  }
  long long best = 0, sum = 0;
  for (int i = 1; i < n; i += 2) {
    sum = max(sum + arr[i] - arr[i - 1], arr[i] - arr[i - 1]);
    best = max(best, sum);
  }
  sum = 0;
  for (int i = 2; i < n; i += 2) {
    sum = max(sum + arr[i - 1] - arr[i], arr[i - 1] - arr[i]);
    best = max(best, sum);
  }
  cout << res + best << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
