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: import sys
  import math
  import heapq
  import bisect
  from collections import Counter
  from collections import defaultdict
  from io import BytesIO, IOBase
  import string
  
  
  class FastIO(IOBase):
      newlines = 0
  
      def __init__(self, file):
          import os
          self.os = os
          self._fd = file.fileno()
          self.buffer = BytesIO()
          self.writable = "x" in file.mode or "r" not in file.mode
          self.write = self.buffer.write if self.writable else None
          self.BUFSIZE = 8192
  
      def read(self):
          while True:
              b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
              if not b:
                  break
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines = 0
          return self.buffer.read()
  
      def readline(self):
          while self.newlines == 0:
              b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
              self.newlines = b.count(b"\n") + (not b)
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines -= 1
          return self.buffer.readline()
  
      def flush(self):
          if self.writable:
              self.os.write(self._fd, self.buffer.getvalue())
              self.buffer.truncate(0), self.buffer.seek(0)
  
  
  class IOWrapper(IOBase):
      def __init__(self, file):
          self.buffer = FastIO(file)
          self.flush = self.buffer.flush
          self.writable = self.buffer.writable
          self.write = lambda s: self.buffer.write(s.encode("ascii"))
          self.read = lambda: self.buffer.read().decode("ascii")
          self.readline = lambda: self.buffer.readline().decode("ascii")
  
  
  sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
  input = lambda: sys.stdin.readline().rstrip("\r\n")
  
  
  def get_int():
      return int(input())
  
  
  def get_ints():
      return list(map(int, input().split(' ')))
  
  
  def get_int_grid(n):
      return [get_ints() for _ in range(n)]
  
  
  def get_str():
      return input().strip()
  
  
  def get_strs():
      return get_str().split(' ')
  
  
  def flat_list(arr):
      return [item for subarr in arr for item in subarr]
  
  
  def yes_no(b):
      if b:
          return "YES"
      else:
          return "NO"
  
  
  def binary_search(good, left, right, delta=1, right_true=False):
      """
      Performs binary search
      ----------
      Parameters
      ----------
      :param good: Function used to perform the binary search
      :param left: Starting value of left limit
      :param right: Starting value of the right limit
      :param delta: Margin of error, defaults value of 1 for integer binary search
      :param right_true: Boolean, for whether the right limit is the true invariant
      :return: Returns the most extremal value interval [left, right] which is good function evaluates to True,
              alternatively returns False if no such value found
      """
  
      limits = [left, right]
      while limits[1] - limits[0] > delta:
          if delta == 1:
              mid = sum(limits) // 2
          else:
              mid = sum(limits) / 2
          if good(mid):
              limits[int(right_true)] = mid
          else:
              limits[int(~right_true)] = mid
      if good(limits[int(right_true)]):
          return limits[int(right_true)]
      else:
          return False
  
  
  def prefix_sums(a):
      p = [0]
      for x in a:
          p.append(p[-1] + x)
      return p
  
  
  def solve_a():
      p = get_int()
      if p == 5:
          return 2, 4
      else:
          return 2, (p - 1) // 2
  
  
  def solve_b():
      n = get_int()
      enemy = list(get_str())
      me = list(get_str())
      cnt = 0
  
      for i in range(n):
          if me[i] == '1' and enemy[i] == '0':
              cnt += 1
          elif i > 0 and me[i] == '1' and enemy[i - 1] == '1':
              enemy[i - 1] = 'x'
              cnt += 1
          elif i < n - 1 and me[i] == '1' and enemy[i + 1] == '1':
              enemy[i + 1] = 'x'
              cnt += 1
      return cnt
  
  
  def solve_c():
      n, m = get_ints()
      num_big = [0] * n
      inv_cnt = n
  
      def add_edge(u, v):
          if u > v:
              u, v = v, u
          u, v = u - 1, v - 1
          num_big[u] += 1
          if num_big[u] == 1:
              return - 1
          return 0
  
      def rem_edge(u, v):
          if u > v:
              u, v = v, u
          u, v = u - 1, v - 1
          num_big[u] -= 1
          if num_big[u] == 0:
              return 1
          return 0
  
      for edge in range(m):
          u, v = get_ints()
          inv_cnt += add_edge(u, v)
  
      q = get_int()
  
      for _ in range(q):
          dat = get_ints()
          if dat[0] == 3:
              print(inv_cnt)
          if dat[0] == 1:
              inv_cnt += add_edge(dat[1], dat[2])
          if dat[0] == 2:
              inv_cnt += rem_edge(dat[1], dat[2])
  
  
  class GCDStack:
      def __init__(self):
          self.s = []
          self.s_gcd = [0]
  
      def push(self, x):
          self.s.append(x)
          self.s_gcd.append(math.gcd(self.s_gcd[-1], x))
  
      def pop(self):
          res = self.s[-1]
          self.s.pop()
          self.s_gcd.pop()
          return res
  
      def gcd(self):
          return self.s_gcd[-1]
  
  
  class GCDQueue:
      def __init__(self):
          self.s1 = GCDStack()
          self.s2 = GCDStack()
  
      def add(self, x):
          self.s1.push(x)
  
      def remove(self):
          if not self.s2.s:
              while self.s1.s:
                  self.s2.push(self.s1.pop())
          return self.s2.pop()
  
      def gcd(self):
          return math.gcd(self.s1.gcd(), self.s2.gcd())
  
      def good(self):
          return self.gcd() != 1
  
  
  
  def solve_d():
      n = get_int()
      a = get_ints()
      d = [a[i] - a[i - 1] for i in range(1, n)]
      Q = GCDQueue()
      M = 0
      l = 0
      for r in range(n - 1):
          Q.add(d[r])
          while not Q.good():
              Q.remove()
              l += 1
          M = max(M, r - l + 1)
      return M + 1
  
  
  t = get_int()
  for _ in range(t):
      print(solve_d())
  