#include<iostream>
using namespace std;
const int N =1e5+10;
int f[N],w[N];
int main()
{
int T; cin>>T;
while(T--)
{
int n; cin>>n;
for(int i=1;i<=n;i++)
scanf("%d",&w[i]);
f[1] = w[1];
for(int i=2;i<=n;i++)
f[i] = max(f[i-1] ,f[i-2] + w[i]);
printf("%d\n",f[n]);
}
return 0;
}