#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 2e5;
long long a[N], b[N], dp[N], pref[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long ans = 0, sum = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      if (i % 2 == 0) ans += a[i];
    }
    int ind = 0;
    sum = ans;
    for (int i = 0; i < n; i += 2) {
      if (i + 1 < n)
        b[ind] = a[i + 1] - a[i];
      else
        b[ind] = -a[i];
      if (ind)
        pref[ind] = pref[ind - 1] + b[ind];
      else
        pref[ind] = b[ind];
      ind++;
    }
    int m = ind;
    dp[0] = b[0];
    if (b[0] < 0)
      ind = 0;
    else
      ind = -1;
    long long mn = min(0LL, b[0]);
    ans = max(ans, sum + dp[0]);
    for (int i = 1; i < m; ++i) {
      if (ind == -1)
        dp[i] = pref[i];
      else
        dp[i] = pref[i] - pref[ind];
      if (pref[i] < mn) {
        mn = pref[i];
        ind = i;
      }
      ans = max(ans, sum + dp[i]);
    }
    ind = 0;
    for (int i = 1; i + 1 < n; i += 2) {
      b[ind] = a[i] - a[i + 1];
      if (ind)
        pref[ind] = pref[ind - 1] + b[ind];
      else
        pref[ind] = b[ind];
      ind++;
    }
    m = ind;
    dp[0] = b[0];
    if (b[0] < 0)
      ind = 0;
    else
      ind = -1;
    mn = min(0LL, b[0]);
    ans = max(ans, sum + dp[0]);
    for (int i = 1; i < m; ++i) {
      if (ind == -1)
        dp[i] = pref[i];
      else
        dp[i] = pref[i] - pref[ind];
      if (pref[i] < mn) {
        mn = pref[i];
        ind = i;
      }
      ans = max(ans, sum + dp[i]);
    }
    cout << ans << "\n";
  }
}
