#include <bits/stdc++.h>
using namespace std;
const long long int inf = 0x3f3f3f3f3f3f3f3fll;
long long int maxSubArraySum(vector<long long int> a, long long int size) {
  long long int max_so_far = -1, max_ending_here = 0;
  for (long long int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
int main() {
  int tt;
  cin >> tt;
  for (int ttt = 1; ttt <= tt; ttt++) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int res = 0;
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    for (long long int i = 0; i < n; i += 2) {
      res += arr[i];
    }
    vector<long long int> v1, v2;
    long long int ans1 = 0, ans2 = 0;
    for (long long int i = 0; i < n - 1; i += 2)
      v1.push_back(arr[i + 1] - arr[i]);
    ans1 = maxSubArraySum(v1, v1.size());
    for (long long int i = 1; i < n - 1; i += 2)
      v2.push_back(arr[i] - arr[i + 1]);
    ans2 = maxSubArraySum(v2, v2.size());
    long long int ans3 = 0;
    cout << res + max(ans1, max(ans3, ans2)) << endl;
  }
  return 0;
}
