#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int n, long long int m);
long long int power(long long int a, long long int n, long long int m) {
  if (n == 0) return 1;
  long long int x = power(a, n / 2, m);
  if (n % 2 != 0)
    return (((a * x) % m) * (x) % m) % m;
  else
    return (x * x) % m;
}
double PI = 3.14159265357;
int32_t main() {
  long long int n, i, j, x, y, m, k, t, sum, count, cnt, b, c, d, j1, z, a,
      temp;
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n;
    long long int arr[n];
    for (i = 0; i < n; i++) cin >> arr[i];
    cnt = 0;
    for (i = 0; i < n; i += 2) cnt += arr[i];
    vector<long long int> v;
    for (i = 1; i < n; i += 2) v.push_back(arr[i] - arr[i - 1]);
    long long int mx = 0;
    sum = 0;
    for (i = 0; i < v.size(); i++) {
      sum += v[i];
      if (sum < 0) sum = 0;
      mx = max(sum, mx);
    }
    v.clear();
    for (i = 2; i < n; i += 2) v.push_back(arr[i - 1] - arr[i]);
    sum = 0;
    for (i = 0; i < v.size(); i++) {
      sum += v[i];
      if (sum < 0) sum = 0;
      mx = max(sum, mx);
    }
    cout << cnt + mx << "\n";
  }
  return 0;
}
