human
What is a the Python code you requested given the following:
PYTHON3 solution for "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.":
assistant
#Here is the Python code you requested.
 #!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

# sys.setrecursionlimit(1000000)

# _INPUT = """4
# 2
# 5 8
# 4
# 8 2 5 10
# 2
# 1000 2000
# 8
# 465 55 3 54 234 12 45 78

# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**20

class SegTree_GCD:
    def __init__(self, a):
        n = len(a)
        self.n1 = 2 ** (n-1).bit_length()
        self.dat = [0] * self.n1 + a + [INF] * (self.n1-n)
        for i in reversed(range(1, self.n1)):
            self.dat[i] = self.gcd1(self.dat[i*2], self.dat[i*2+1])
    
    def gcd1(self, v1, v2) -> int:
        if v1 == INF:
            return v2
        elif v2 == INF:
            return v1
        else:
            return math.gcd(v1, v2)

    def get_rgcd(self, l, r) -> int:
        l += self.n1
        r += self.n1
        v = INF
        while l < r:
            if l & 1:
                v = self.gcd1(v, self.dat[l])
                l += 1
            if r & 1:
                v = self.gcd1(v, self.dat[r-1])
                r -= 1
            l //= 2
            r //= 2
        return v

def solve(N, A):
    if N == 1:
        return 1

    B = [A[i+1] - A[i] for i in range(N-1)]
    
    segt_gcd = SegTree_GCD(B)
    length = 0
    r = 1
    for l in range(N-1):
        r = l + length
        while r+1 <= N-1 and segt_gcd.get_rgcd(l, r+1) not in [1, -1]:
            r += 1
        length = max(length, r-l)

    return length + 1

T0 = int(input())
for _ in range(T0):
    N = int(input())
    A = list(map(int, input().split()))
    print(solve(N, A))