#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> a(n);
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (i & 1 ^ 1) sum += a[i];
    }
    vector<int> x, y;
    for (int i = 1; i < n; i += 2) {
      x.push_back(a[i] - a[i - 1]);
      if (i + 1 < n) y.push_back(a[i] - a[i + 1]);
    }
    long long sumx = 0, bestx = 0, sumy = 0, besty = 0;
    for (long long p : x) {
      sumx = max(sumx + p, p);
      bestx = max(bestx, sumx);
    }
    for (long long p : y) {
      sumy = max(sumy + p, p);
      besty = max(besty, sumy);
    }
    cout << max({sum, sum + bestx, sum + besty}) << "\n";
  }
  return 0;
}
