description: British mathematician John Littlewood once said about Indian mathematician Srinivasa Ramanujan that "every positive integer was one of his personal friends."
  
  It turns out that positive integers can also be friends with each other! You are given an array a of distinct positive integers. 
  
  Define a subarray a_i, a_{i+1}, …, a_j to be a friend group if and only if there exists an integer m ≥ 2 such that a_i mod m = a_{i+1} mod m = … = a_j mod m, where x mod y denotes the remainder when x is divided by y.
  
  Your friend Gregor wants to know the size of the largest friend group in a.
  
  Input
  
  Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 2⋅ 10^4). 
  
  Each test case begins with a line containing the integer n (1 ≤ n ≤ 2 ⋅ 10^5), the size of the array a.
  
  The next line contains n positive integers a_1, a_2, …, a_n (1 ≤ a_i ≤ {10}^{18}), representing the contents of the array a. It is guaranteed that all the numbers in a are distinct.
  
  It is guaranteed that the sum of n over all test cases is less than 2⋅ 10^5.
  
  Output
  
  Your output should consist of t lines. Each line should consist of a single integer, the size of the largest friend group in a.
  
  Example
  
  Input
  
  
  4
  5
  1 5 2 4 6
  4
  8 2 5 10
  2
  1000 2000
  8
  465 55 3 54 234 12 45 78
  
  
  Output
  
  
  3
  3
  2
  6
  
  Note
  
  In the first test case, the array is [1,5,2,4,6]. The largest friend group is [2,4,6], since all those numbers are congruent to 0 modulo 2, so m=2.
  
  In the second test case, the array is [8,2,5,10]. The largest friend group is [8,2,5], since all those numbers are congruent to 2 modulo 3, so m=3.
  
  In the third case, the largest friend group is [1000,2000]. There are clearly many possible values of m that work.
solution: #from itertools import product, permutations, combinations, accumulate, compress
  #from collections import Counter, defaultdict, deque # deque([iterable[, maxlen]]) #appendleft popleft rotate
  #from heapq import heapify, heappop, heappush # func(heapifiedlist, item)
  #from bisect import bisect_left, bisect_right, insort # func(sortedlist, item)
  # TODO: more coping mechanisms...?
  #from sys import setrecursionlimit
  
  import os, sys
  input = lambda: sys.stdin.buffer.readline().rstrip(b'\r\n')
  
  def dbp(*args, **kwargs): # calling with dbp(locals()) is perfectly cromulent
  	print(*args, file=sys.stderr, **kwargs)
  
  a_str = lambda: input().decode('ascii')
  get_int_list = lambda: [int(x) for x in input().split()]
  join_str = lambda l, ch=' ': ch.join((str(x) for x in l))  # ch is a default, not kwarg
  
  from math import gcd
  
  class segtree():
  	def __init__(self, opf, alist):
  		self.merge = opf
  		if opf == gcd:
  			self.default = 0
  		else:
  			raise Exception('woopth')
  		self.n = len(alist) # no kth ele, non power of 2 ok
  		self.st = [0] * (2*self.n)
  		self.st[self.n:] = alist
  		for i in range(self.n-1, 0, -1):
  			self.st[i] = self.merge(self.st[i<<1], self.st[i<<1|1])
  
  	# uhhh, static...  so just query...
  	def query(self, l, r):
  		l += self.n
  		r += self.n
  		ans = self.default
  		while l < r:
  			if l&1:
  				ans = self.merge(ans, self.st[l])
  				l += 1
  			if r&1:
  				r -= 1
  				ans = self.merge(ans, self.st[r])
  			l >>= 1
  			r >>= 1
  		return ans
  
  def do_thing():
  	n = int(input())
  	alist = get_int_list()
  	#dbp('case:', alist)
  
  	if n == 1:
  		return 1
  
  	difflist = [abs(alist[i]-alist[i-1]) for i in range(1, n)] + [1]
  	#dbp('difflist:', difflist)
  	gcdst = segtree(gcd, difflist)
  
  	ans = 1
  	for l in range(n-1):
  		r = l+ans
  		if r >=n:
  			break
  		g = gcdst.query(l, r)
  		#dbp('queried:', difflist[l:r], 'got:', g)
  		if g == 1:
  			continue
  
  		while r < n and g > 1:
  			#dbp('checking:', g, difflist[r])
  			g = gcd(g, difflist[r])
  			r += 1
  
  		ans = max(ans, r-l)
  			
  	return ans
  
  def multicase():
  	maxcc = int(input().strip())
  	for cc in range(maxcc):
  		print(do_thing())
  
  if __name__ == "__main__":
  	multicase()
  	#print(do_thing())