#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int xy=1;xy<=t;xy++)
{
int n;
cin>>n;
int a[n];
long long int sum=0;
for(int j=0;j<(n);j++)
{
cin>>a[j];
if((j%2)==0)
sum=sum+a[j];
}
vector<int> v1;
for(int i=1;i<(n);i=i+2)
{
v1.push_back(a[i]-a[i-1]);
}
vector<int> v2;
for(int i=2;i<n;i=i+2)
{
v2.push_back(a[i-1]-a[i]);
}
long long int sum1=0;
long long int maxi1=0;
for(int i=0;i<v1.size();i++)
{
sum1=sum1+v1[i];
if(sum1<0)
sum1=0;
else
maxi1=max(maxi1,sum1);
}
sum1=0;
for(int i=0;i<v2.size();i++)
{
sum1=sum1+v2[i];
if(sum1<0)
sum1=0;
else
maxi1=max(maxi1,sum1);
}
cout<<(sum+maxi1)<<endl;
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKQp7CiAgICBpbnQgdDsKICAgIGNpbj4+dDsKICAgIGZvcihpbnQgeHk9MTt4eTw9dDt4eSsrKQogICAgewogICAgICAgIGludCBuOwogICAgICAgIGNpbj4+bjsKICAgICAgICBpbnQgYVtuXTsKICAgICAgICBsb25nIGxvbmcgaW50IHN1bT0wOwogICAgICAgIGZvcihpbnQgaj0wO2o8KG4pO2orKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY2luPj5hW2pdOwogICAgICAgICAgICAgICAgaWYoKGolMik9PTApCiAgICAgICAgICAgICAgICAgICAgc3VtPXN1bSthW2pdOwogICAgICAgICAgICB9CiAgICAgICAgdmVjdG9yPGludD4gdjE7CiAgICAgICAgZm9yKGludCBpPTE7aTwobik7aT1pKzIpCiAgICAgICAgewogICAgICAgICAgICB2MS5wdXNoX2JhY2soYVtpXS1hW2ktMV0pOwogICAgICAgIH0KICAgICAgICB2ZWN0b3I8aW50PiB2MjsKICAgICAgICBmb3IoaW50IGk9MjtpPG47aT1pKzIpCiAgICAgICAgewogICAgICAgICAgICB2Mi5wdXNoX2JhY2soYVtpLTFdLWFbaV0pOwogICAgICAgIH0KICAgICAgICBsb25nIGxvbmcgaW50IHN1bTE9MDsKICAgICAgICBsb25nIGxvbmcgaW50IG1heGkxPTA7CiAgICAgICAgZm9yKGludCBpPTA7aTx2MS5zaXplKCk7aSsrKQogICAgICAgIHsKICAgICAgICAgICAgc3VtMT1zdW0xK3YxW2ldOwogICAgICAgICAgICBpZihzdW0xPDApCiAgICAgICAgICAgICAgICBzdW0xPTA7CiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgIG1heGkxPW1heChtYXhpMSxzdW0xKTsKICAgICAgICB9CiAgICAgICAgc3VtMT0wOwogICAgICAgIGZvcihpbnQgaT0wO2k8djIuc2l6ZSgpO2krKykKICAgICAgICB7CiAgICAgICAgICAgIHN1bTE9c3VtMSt2MltpXTsKICAgICAgICAgICAgaWYoc3VtMTwwKQogICAgICAgICAgICAgICAgc3VtMT0wOwogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBtYXhpMT1tYXgobWF4aTEsc3VtMSk7CiAgICAgICAgfQogICAgICAgIGNvdXQ8PChzdW0rbWF4aTEpPDxlbmRsOwogICAgfQp9Cg==