#include <bits/stdc++.h>
const long long N = 1e9 + 7;
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, sum(0);
    cin >> n;
    vector<long long> v(n), v1, v2;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      if (i % 2 == 0) sum += v[i];
    }
    long long m = n / 2;
    for (long long i = 0; i < m; i++) {
      v1.push_back(v[2 * i + 1] - v[2 * i]);
    }
    if (n & 1) m++;
    for (long long i = 1; i < m; i++) {
      v2.push_back(v[2 * i - 1] - v[2 * i]);
    }
    long long c1(0), c2(-N), c3(0), c4(-N);
    for (long long i = 0; i < v1.size(); i++) {
      c1 += v1[i];
      if (c2 < c1) c2 = c1;
      if (c1 < 0) c1 = 0;
    }
    for (long long i = 0; i < v2.size(); i++) {
      c3 += v2[i];
      if (c4 < c3) c4 = c3;
      if (c3 < 0) c3 = 0;
    }
    cout << max(sum, sum + max(c4, c2)) << endl;
  }
}
