import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;
public class Main {
private static StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
private static BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
private static PrintWriter out = new PrintWriter(System.out);
// StreamTokenizer
private static int ini() throws IOException {
st.nextToken();
return (int) st.nval;
}
private static double ind() throws IOException {
st.nextToken();
return st.nval;
}
private static String ins() throws IOException {
st.nextToken();
return st.sval;
}
static int [][] tangle=new int[1010][1010];
// static int [][] F=new int[1010][1010];
static int n,m;
static int []arr=new int[100010];
static int [] F=new int[100010];
public static void main(String[] args) throws IOException {
// StreamTokenizer输入
// int n = ini();
// double m = ind();
// String s = ins();
// // BufferedReader输入
// String line1 = bin.readLine(); // 5
// int x = Integer.parseInt(line1);
// double y = Double.parseDouble(line1);
n=ini();
while ((n–)!=0)
{
m=ini();
for (int i=1;i<=m;i++)
{
arr[i]=ini();
}
Arrays.fill(F,0);
for (int i=m;i>=1;i–)
{
F[i]=Math.max(F[i+1],F[i+2]+arr[i]);
}
System.out.println(F[1]);
}
// String[] line=bin.readLine().split(” “);
// int n=Integer.parseInt(line[0]);
// for(int i=1;i<=n;i) {
// line=bin.readLine().split(” “);
// for(int j=1;j<=i;j) {
// tangle[i][j]=Integer.parseInt(line[j-1]);
// }
// }
//
// for (int i=n;i>=0;i–)
// {
// for(int j=1;j<=i;j++)
// {
// F[i][j]=Math.max(F[i+1][j],F[i+1][j+1])+tangle[i][j];
// }
// }
// System.out.println(F[1][1]);
}
}