import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		auto a = readln.splitter.map !(to !(int)).array;
		long [] [] s = [[0], [0], [0]];
		foreach (i, c; a)
		{
			s[0] ~= s[0][$ - 1] + !(i & 1) * c;
			s[1] ~= s[1][$ - 1] + (i & 1) * c;
			s[2] ~= s[1][$ - 1] - s[0][$ - 1];
		}
		long res = 0;
		long [2] lo = [long.max / 2, 0];
		foreach (i; 0..n)
		{
			lo[i & 1] = min (lo[i & 1], s[2][i + 1]);
			res = max (res, s[2][i + 1] - lo[i & 1]);
		}
		writeln (res + s[0].back);
	}
}
