#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int sum1 = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
        sum1 += arr[i];
      }
    }
    long long int diff = 0;
    long long int max1diff = 0;
    for (int i = 0; i + 1 < n; i += 2) {
      diff += arr[i + 1] - arr[i];
      if (diff > 0) {
        max1diff = max(diff, max1diff);
      } else {
        diff = 0;
      }
    }
    diff = 0;
    for (int i = 1; i + 1 < n; i += 2) {
      diff += arr[i] - arr[i + 1];
      if (diff > 0) {
        max1diff = max(diff, max1diff);
      } else {
        diff = 0;
      }
    }
    cout << sum1 + max1diff << endl;
  }
}
