#include <bits/stdc++.h>
using namespace std;
long long dp[200009];
int main() {
  long long t, n, i, j, sum = 0, maxx, s1, s2;
  cin >> t;
  while (t--) {
    cin >> n;
    sum = 0;
    for (i = 1; i <= n; i++) {
      cin >> dp[i];
      if (i % 2 != 0) sum += dp[i];
    }
    maxx = 0, s1 = 0, s2 = 0;
    for (i = 2; i <= n; i += 2) {
      s1 = max((long long)0, dp[i] - dp[i - 1] + s1);
      maxx = max(s1, maxx);
    }
    for (i = 3; i <= n; i += 2) {
      s2 = max((long long)0, dp[i - 1] - dp[i] + s2);
      maxx = max(s2, maxx);
    }
    cout << maxx + sum << endl;
  }
  return 0;
}
