#include <iostream>
#include <cstring>
using namespace std;
const int N = 1E5 + 10;
int v[N], f[N][2]; // 0 不抢 1 抢
int main(){
int T; cin >> T;
while(T -- ){
int n; cin >> n;
for(int i = 2; i <= n + 1; i ++ ) cin >> v[i];
memset(f, 0, sizeof f);
for(int i = 2; i <= n + 1; i ++ ){
f[i][0] = max(f[i - 1][0], f[i - 1][1]);
f[i][1] = f[i - 1][0] + v[i];
}
cout << max(f[n + 1][0], f[n + 1][1]) << endl;
}
return 0;
}