import std.algorithm;
import std.conv;
import std.math;
import std.numeric;
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 !(long)).array;

		long [] b;
		foreach (i; 1..n)
		{
			b ~= abs (a[i] - a[i - 1]);
		}

		int res = 1;
		int lo = 0;
		long cur = 0;
		for (int hi = 0; hi < n - 1; hi++)
		{
			long next = gcd (cur, b[hi]);
			if (next == 1)
			{
				next = 0;
				lo = hi + 1;
				while (lo > 0)
				{
					long temp = gcd (next, b[lo - 1]);
					if (temp == 1)
					{
						break;
					}
					lo -= 1;
					next = temp;
				}
			}
			cur = next;
			res = max (res, hi - lo + 2);
		}
		writeln (res);
	}
}
