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 java.util.*;
  import java.io.*;
  import static java.lang.Math.*;
  
  public class ACMIND
  {
      static FastReader scan;
      static PrintWriter pw;
      static long MOD = 1_000_000_007;
      static long INF = 2_000_000_000_000_000_000L;
      static long inf = 2_000_000_000;
      public static void main(String[] args) {
          new Thread(null,null,"_",1<<27)
          {
              public void run()
              {
                  try
                  {
                      solve();
                  }
                  catch(Exception e)
                  {
                      e.printStackTrace();
                      System.exit(1);
                  }
              }
          }.start();
      }
  
  
      static void solve() throws IOException {
          scan = new FastReader();
          pw = new PrintWriter(System.out, true);
          StringBuilder sb = new StringBuilder();
  
          int t = ni();
          while (t-->0) {
              int n = ni();
              long arr[] = new long[n-1];
              long prev = nl();
              for(int i=0;i<n-1;i++) {
                  arr[i] = nl() - prev;
                  prev = prev + arr[i];
                  arr[i] = abs(arr[i]);
              }
  
              if(n==1) {
                  pl(1);
              }
              else {
                  pl(findLargestSubarray(arr) + 1);
              }
          }
  
          pw.flush();
          pw.close();
      }
  
      static int findLargestSubarray(long arr[]) {
          // pa("arr", arr);
          int n = arr.length;
          int MAX = (int)(log(n) / log(2));
          long sp[][] = new long[n][MAX+1];
          for(int i=0;i<n;i++) {
              sp[i][0] = arr[i];
          }
          for(int r=1;r<=MAX;r++) {
              for(int i=0;i<n;i++) {
                  if((i+(1<<(r-1))) < n) {
                      sp[i][r] = gcd(sp[i][r-1], sp[i+(1<<(r-1))][r-1]);
                  }
                  else {
                      sp[i][r] = sp[i][r-1];
                  }
              }
          }
  
          // pa("sp", sp);
  
          int max = 0;
          for(int i=0;i<n;i++) {
              long curr = 0;
              int start = i;
              for(int j=MAX;j>=0 && start<n;--j) {
                  long g = gcd(curr, sp[start][j]);
                  if(g>1) {
                      curr = g;
                      start = start + (1<<j);
                  }
              }
  
              start = min(start, n);
              max = max(max, start - i);
          }
  
          return max;
      }
  
      static long gcd(long a, long b) {
          if(b==0) {
              return a;
          }
          return gcd(b,a%b);
      }
  
      static void assert_in_range(String varName, int n, int l, int r) {
          if (n >=l && n<=r) return;
          System.out.println(varName + " is not in range. Actual: "+n+" l : "+l+" r: "+r);
          System.exit(1);
      }
      static void assert_in_range(String varName, long n, long l, long r) {
          if (n>=l && n<=r) return;
          System.out.println(varName + " is not in range. Actual: "+n+" l : "+l+" r: "+r);
          System.exit(1);
      }
  
      static int ni() throws IOException
      {
          return scan.nextInt();
      }
      static long nl() throws IOException
      {
          return scan.nextLong();
      }
      static double nd() throws IOException
      {
          return scan.nextDouble();
      }
      static void pl()
      {
          pw.println();
      }
      static void p(Object o)
      {
          pw.print(o+" ");
      }
      static void pl(Object o)
      {
          pw.println(o);
      }
      static void psb(StringBuilder sb)
      {
          pw.print(sb);
      }
      static void pa(String arrayName, Set<Object> set)
      {
          pl(arrayName+" : ");
          for(Object o : set)
              p(o);
          pl();
      }
      static void pa(String arrayName, Object arr[])
      {
          pl(arrayName+" : ");
          for(Object o : arr)
              p(o);
          pl();
      }
      static void pa(String arrayName, int arr[])
      {
          pl(arrayName+" : ");
          for(int o : arr)
              p(o);
          pl();
      }
      static void pa(String arrayName, long arr[])
      {
          pl(arrayName+" : ");
          for(long o : arr)
              p(o);
          pl();
      }
      static void pa(String arrayName, double arr[])
      {
          pl(arrayName+" : ");
          for(double o : arr)
              p(o);
          pl();
      }
      static void pa(String arrayName, char arr[])
      {
          pl(arrayName+" : ");
          for(char o : arr)
              p(o);
          pl();
      }
      static void pa(String listName, List list)
      {
          pl(listName+" : ");
          for(Object o : list)
              p(o);
          pl();
      }
      static void pa(String arrayName, Object[][] arr) {
          pl(arrayName+" : ");
          for(int i=0;i<arr.length;++i) {
              for(Object o : arr[i])
                  p(o);
              pl();
          }
      }
      static void pa(String arrayName, int[][] arr) {
          pl(arrayName+" : ");
          for(int i=0;i<arr.length;++i) {
              for(int o : arr[i])
                  p(o);
              pl();
          }
      }
      static void pa(String arrayName, long[][] arr) {
          pl(arrayName+" : ");
          for(int i=0;i<arr.length;++i) {
              for(long o : arr[i])
                  p(o);
              pl();
          }
      }
      static void pa(String arrayName, char[][] arr) {
          pl(arrayName+" : ");
          for(int i=0;i<arr.length;++i) {
              for(char o : arr[i])
                  p(o);
              pl();
          }
      }
      static void pa(String arrayName, double[][] arr) {
          pl(arrayName+" : ");
          for(int i=0;i<arr.length;++i) {
              for(double o : arr[i])
                  p(o);
              pl();
          }
      }
      static class FastReader {
          final private int BUFFER_SIZE = 1 << 16;
          private DataInputStream din;
          private byte[] buffer;
          private int bufferPointer, bytesRead;
  
          public FastReader() {
              din = new DataInputStream(System.in);
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public FastReader(String file_name) throws IOException {
              din = new DataInputStream(new FileInputStream(file_name));
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public String readLine() throws IOException {
              byte[] buf = new byte[1000000];
              int cnt = 0, c;
              while ((c = read()) != -1) {
                  if (c == '\n') break;
                  buf[cnt++] = (byte) c;
              }
              return new String(buf, 0, cnt);
          }
  
          public int nextInt() throws IOException {
              int ret = 0;
              byte c = read();
              while (c <= ' ') c = read();
              boolean neg = (c == '-');
              if (neg) c = read();
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
              if (neg) return -ret;
              return ret;
          }
  
          public long nextLong() throws IOException {
              long ret = 0;
              byte c = read();
              while (c <= ' ') c = read();
              boolean neg = (c == '-');
              if (neg) c = read();
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
              if (neg) return -ret;
              return ret;
          }
  
          public double nextDouble() throws IOException {
              double ret = 0, div = 1;
              byte c = read();
              while (c <= ' ') c = read();
              boolean neg = (c == '-');
              if (neg) c = read();
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
              if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10);
              if (neg) return -ret;
              return ret;
          }
  
          private void fillBuffer() throws IOException {
              bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
              if (bytesRead == -1) buffer[0] = -1;
          }
  
          private byte read() throws IOException {
              if (bufferPointer == bytesRead) fillBuffer();
              return buffer[bufferPointer++];
          }
  
          public void close() throws IOException {
              if (din == null) return;
              din.close();
          }
      }
  }