#include <bits/stdc++.h>
using namespace std;
int arr[100005];
vector<int> prime;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n, i, j, k, l;
    long long int ans = 0, cc = 0, MX = 0;
    cin >> n;
    vector<long long int> vec, vec2;
    long long int arr[n];
    for (i = 0; i < n; i++) {
      cin >> arr[i];
      if (i % 2)
        vec.push_back(arr[i] - arr[i - 1]);
      else {
        ans += arr[i];
        if (i) vec2.push_back(arr[i - 1] - arr[i]);
      }
    }
    for (i = 0; i < vec.size(); i++)
      cc += vec[i], cc = max(0ll, cc), MX = max(MX, cc);
    cc = 0;
    for (i = 0; i < vec2.size(); i++)
      cc += vec2[i], cc = max(0ll, cc), MX = max(MX, cc);
    cout << (ans + MX) << endl;
  }
  return 0;
}
