#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
template <typename T>
void read(T &x) {
  int f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  x *= f;
}
template <typename T>
void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
void println(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
  putchar('\n');
}
template <typename T, typename... Args>
void read(T &x, Args &...args) {
  read(x);
  read(args...);
}
inline void reads(char *a) { scanf("%s", a); }
template <typename... Args>
void reads(char *a, Args *...args) {
  scanf("%s", a);
  reads(args...);
}
template <typename T, typename... Args>
void print(T x, Args... args) {
  print(x);
  putchar(' ');
  print(args...);
}
template <typename T, typename... Args>
void println(T x, Args... args) {
  print(x);
  putchar(' ');
  println(args...);
}
inline void prints(char *a) { printf("%s", a); }
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline T random(T R) {
  return (double)rand() / RAND_MAX * R + ((T)0.5 == 0 ? 0.5 : 0.0);
}
template <typename T>
inline T random(T L, T R) {
  return random(R - L) + L;
}
long long ksm(long long a, long long k, long long Mod) {
  long long res = 1;
  while (k) {
    if (k & 1) (res *= a) %= Mod;
    (a *= a) %= Mod;
    k >>= 1;
  }
  return res % Mod;
}
inline long long inv(long long a, long long Mod) {
  return ksm(a, Mod - 2, Mod);
}
inline void cap_bit(long long x) {
  for (int i = 63; i >= 0; --i)
    if (x >> i & 1) {
      printf("Need (%d) = %lld\n", i + 1, 1LL << (i + 1));
      return;
    }
}
inline void cal_space(long long x) { printf("%lld MB\n", x >> 20); }
const int dx4[] = {0, 0, -1, 1};
const int dy4[] = {-1, 1, 0, 0};
const int dx6[] = {1, -1, 0, 0, 0, 0};
const int dy6[] = {0, 0, 1, -1, 0, 0};
const int dz6[] = {0, 0, 0, 0, 1, -1};
const int N = 1e6 + 5;
const int M = 21;
const long long Mod = 1e9 + 7;
const long long INF = 1e16;
long long T;
long long n;
long long a[N];
vector<long long> a0, a1;
int main() {
  cin >> T;
  while (T--) {
    long long sum = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; i += 2) sum += a[i];
    a0.clear();
    a1.clear();
    for (int i = 0; i + 1 < n; i += 2) a0.push_back(a[i + 1] - a[i]);
    for (int i = 1; i + 1 < n; i += 2) a1.push_back(a[i] - a[i + 1]);
    long long cur = 0;
    long long tmax = 0;
    for (auto i : a0) {
      cur += i;
      if (cur < 0) cur = 0;
      tmax = max(tmax, cur);
    }
    cur = 0;
    for (int i : a1) {
      cur += i;
      if (cur < 0) cur = 0;
      tmax = max(tmax, cur);
    }
    cout << tmax + sum << endl;
  }
  return 0;
}
