#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &it : a) cin >> it;
    vector<vector<long long>> dp(n + 1, vector<long long>(3));
    for (int i = 0; i < n; ++i) {
      dp[i + 1][0] = dp[i][0] + (i & 1 ? 0 : a[i]);
      if (i + 2 <= n)
        dp[i + 2][1] = max(dp[i][0], dp[i][1]) + (i & 1 ? a[i] : a[i + 1]);
      dp[i + 1][2] = max({dp[i][0], dp[i][1], dp[i][2]}) + (i & 1 ? 0 : a[i]);
    }
    cout << max({dp[n][0], dp[n][1], dp[n][2]}) << endl;
  }
  return 0;
}
