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: /*Everything is Hard 
   * Before Easy 
   * Jai Mata Dii 
   */ 
   
  import java.util.*;
  import java.io.*; 
    
  public class Main { 
  	static class FastReader{ BufferedReader br;StringTokenizer st;public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException  e){e.printStackTrace();}}return st.nextToken();}int nextInt(){ return Integer.parseInt(next());}long nextLong(){return Long.parseLong(next());}double nextDouble(){return Double.parseDouble(next());}String nextLine(){String str = ""; try{str = br.readLine(); } catch (IOException e) {e.printStackTrace();} return str; }} 
  	static long mod = (long)(1e9+7); 
  	// static long mod = 998244353; 
  //	 static Scanner sc = new Scanner(System.in); 
  	static FastReader sc = new FastReader(); 
  	static PrintWriter out = new PrintWriter(System.out);
  	static TreeSet<Integer> g[];
  	public static void main (String[] args) { 
  		int ttt = 1;
  		ttt = sc.nextInt();
  		z :for(int tc=1;tc<=ttt;tc++){
  			int n = sc.nextInt();
  			long a[] = new long[n];
  			for(int i=0;i<n;i++) {
  				a[i] = sc.nextLong();
  			}
  			long dif[] = new long[n];
  			for(int i=1;i<n;i++) {
  				dif[i-1] = Math.abs(a[i]-a[i-1]);
  			}
  			SegTree tre = new SegTree(dif);
  			int ans = 0, l = 0, r = 0;
  			while(r<n-1) {
  				long cgcd = tre.query(l, r);
  				while(cgcd==1 && l<=r) {
  					l++;
  					cgcd = tre.query(l, r);
  				}
  				ans = Math.max(ans, r-l+1);
  				r++;
  			}
  			ans = ans + 1;
  			out.write(ans+"\n");
  		}
  		out.close();
  		//410 52 51 180 222 33 33
  	}
  	static long pow(long a, long b){long ret = 1;while(b>0){if(b%2 == 0){a = (a*a)%mod;b /= 2;}else{ret = (ret*a)%mod;b--;}}return ret%mod;}
  	static long gcd(long a,long b){if(b==0) return  a; return gcd(b,a%b); } 
  	private static void sort(int[] a) {List<Integer> k = new ArrayList<>();for(int val : a) k.add(val);Collections.sort(k);for(int i=0;i<a.length;i++) a[i] = k.get(i);} 
  	private static void ini(List<Integer>[] tre2){for(int i=0;i<tre2.length;i++){tre2[i] = new ArrayList<>();}} 
  	private static void init(List<int[]>[] tre2){for(int i=0;i<tre2.length;i++){tre2[i] = new ArrayList<>();}} 
  	private static void sort(long[] a) {List<Long> k = new ArrayList<>();for(long val : a) k.add(val);Collections.sort(k);for(int i=0;i<a.length;i++) a[i] = k.get(i);} 
  }
  class SegTree {
  	static int n;
  	static long segTree[];
  	static long a[];
  	public SegTree(int n) {
  		segTree = new long[4*n];
  		a = new long[n];
  	}
  	static long gcd(long a,long b){if(b==0) return  a; return gcd(b,a%b); } 
  	public SegTree(long b[]) {
  		segTree = new long[4*b.length+10];
  		a = b;
  		build(0,0,a.length-1);
  	}
  	private static void build(int idx, int low, int high) {
  		if(low == high) {
  			segTree[idx] = a[low];
  			return;
  		}
  		
  		int mid = (low+high)/2;
  		
  		build(2*idx+1,low,mid);
  		build(2*idx+2,mid+1,high);
  		
  		segTree[idx] = gcd(segTree[2*idx+1], segTree[2*idx+2]);
  	}
  	public static long query(int l , int r) {
  		return Query(0,0,a.length-1,l,r);
  	}
  	static long Query(int idx,int low,int high,int l,int r) {
  		
  		if(r<low || l>high) return 0;
  		
  		if(l<=low && r>=high)
  			return segTree[idx];
  		
  		int mid = (low+high)>>1;
  		
  		long left = Query(2*idx+1,low,mid,l,r);
  		long right = Query(2*idx+2,mid+1,high,l,r);
  		
  		return gcd(left, right);
  	}
  }
  