#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n], i;
    vector<int> v1, v2;
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n - 1; i += 2) v1.push_back(a[i + 1] - a[i]);
    for (i = 1; i < n - 1; i += 2) v2.push_back(a[i] - a[i + 1]);
    long long int cursum = 0, maxsum = INT_MIN;
    for (auto x : v1) {
      cursum += x;
      maxsum = max(maxsum, cursum);
      if (cursum < 0) cursum = 0;
    }
    cursum = 0;
    for (auto x : v2) {
      cursum += x;
      maxsum = max(maxsum, cursum);
      if (cursum < 0) cursum = 0;
    }
    long long int sum = 0;
    for (int i = 0; i < n; i += 2) sum += a[i];
    if (maxsum > 0) sum += maxsum;
    cout << sum << endl;
  }
  return 0;
}
