#include <bits/stdc++.h>
using namespace std;
void _main(void) {
  int n;
  cin >> n;
  vector<long long> arr;
  do {
    arr.resize(n);
    for (auto& a : arr) cin >> a;
  } while (false);
  vector<long long> diff;
  for (int i = 1; i + 1 < n; i += 2) {
    diff.emplace_back(arr[i] - arr[i + 1]);
  }
  long long one = 0;
  if (diff.size()) {
    vector<long long> memo(diff.size());
    memo[0] = diff[0];
    one = memo[0];
    for (int i = 1; i < (int)diff.size(); ++i) {
      memo[i] = ((memo[i - 1] + diff[i]) > (diff[i]) ? (memo[i - 1] + diff[i])
                                                     : (diff[i]));
      one = ((one) > (memo[i]) ? (one) : (memo[i]));
    }
  }
  diff.clear();
  for (int i = 0; i + 1 < n; i += 2) {
    diff.emplace_back(arr[i + 1] - arr[i]);
  }
  long long two = 0;
  if (diff.size()) {
    vector<long long> memo(diff.size());
    memo[0] = diff[0];
    two = memo[0];
    for (int i = 1; i < (int)diff.size(); ++i) {
      memo[i] = ((memo[i - 1] + diff[i]) > (diff[i]) ? (memo[i - 1] + diff[i])
                                                     : (diff[i]));
      two = ((two) > (memo[i]) ? (two) : (memo[i]));
    }
  }
  long long acc = 0;
  for (int i = 0; i < n; i += 2) {
    acc += arr[i];
  }
  cout << ((acc) > (acc + ((one) > (two) ? (one) : (two)))
               ? (acc)
               : (acc + ((one) > (two) ? (one) : (two))))
       << '\n';
  return;
}
int main(void) {
  cin.sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
  cin >> t;
  do {
    _main();
  } while (--t);
  return EXIT_SUCCESS;
}
