#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, k;
    cin >> n;
    vector<long long> dp(n + 3, 0);
    vector<long long> v;
    long long sum = 0;
    for (int j = 0; j < n; j++) {
      cin >> k;
      if (j % 2 == 0) {
        sum = sum + k;
      }
      v.push_back(k);
    }
    dp[0] = 0;
    long long ans = 0;
    long long z = 0;
    if (n > 1) {
      dp[1] = max(z, v[1] - v[0]);
      ans = max(ans, dp[1]);
    }
    k = 2;
    for (int j = 1; j < n - 1; j++) {
      if (j % 2 == 0) {
        dp[k] = max(z, dp[k - 2] + (v[j + 1] - v[j]));
      } else {
        dp[k] = max(z, dp[k - 2] + (v[j] - v[j + 1]));
      }
      ans = max(ans, dp[k]);
      k++;
    }
    cout << sum + ans << endl;
  }
}
