//1 test case failing
please help!
int a[1000000];
int dp[1000000];
int n,i;
int solve(int idx){
if(idx>=n){
return 0;
}
if(dp[idx]!=0){
return dp[idx];
}
int sum1 = a[idx] + solve(idx+2);
int sum2 = solve(idx+1);
dp[idx] = max(sum1,sum2);
return max(sum1,sum2);
}
int main() {
int t;
cin>>t;
while(t--){
cin>>n;
for(i=0;i<n;i++){
cin>>a[i];
}
cout<<solve(0)<<endl;
memset(a,0,sizeof(a));
memset(dp,0,sizeof(dp));
}
return 0;
}