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 com.sun.source.tree.Tree;
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.HashMap;
  import java.util.TreeSet;
  
  /**
   * Built using CHelper plug-in
   * Actual solution is at the top
   */
  public class Solution {
      public static void main(String[] args) {
          InputStream inputStream = System.in;
          OutputStream outputStream = System.out;
          InputReader in = new InputReader(inputStream);
          PrintWriter out = new PrintWriter(outputStream);
          Main solver = new Main();
          boolean multipleTC = true;
          int testCount = multipleTC ? Integer.parseInt(in.next()) : 1;
          for (int i = 1; i <= testCount; i++)
              solver.solve(in, out, i);
          out.close();
      }
      static class Main {
          PrintWriter out;
          InputReader in;
  
          long[] segtree;
          long merge(long x, long y){
              return gcd(x, y);
          }
          void build_segtree(int n){
              int i = 0;
              for(i = n - 1; i > 0; i--)
                  segtree[i] = merge(segtree[i << 1], segtree[i << 1 | 1]);
          }
          long segtree_query(int l, int r, int n){
              long res = 0;
              for(l += n, r += n; l < r; l >>= 1, r >>= 1){
                  if((l & 1) == 1)
                      res = merge(res, segtree[l++]);
                  if((r & 1) == 1)
                      res = merge(res, segtree[--r]);
              }
              return res;
          }
  
  
          public void solve(InputReader in, PrintWriter out, int test) {
              this.out = out;
              this.in = in;
              int n = ni();
              long[] arr = new long[n];
              segtree = new long[2 * n];
              for(int i = 0; i < n; i++)
                  arr[i] = nl();
              for(int i = 0; i < n - 1; i++)
                  segtree[n - 1 + i] = Math.abs(arr[i] - arr[i + 1]);
              build_segtree(n - 1);
              int ans = 1;
              for(int i = 0; i < n - 1; i++){
                  int lo = i, hi = n - 2, ind = -1;
                  while(lo <= hi) {
                      int mid = (lo + hi) >> 1;
                      if(segtree_query(i, mid + 1, n - 1) > 1) {
                          lo = mid + 1;
                          ind = mid;
                      } else {
                          hi = mid - 1;
                      }
                  }
                  ans = Math.max(ind - i + 2, ans);
              }
              pn(ans);
          }
  
          long gcd(long a, long b)
          {
              if (a == 0)
                  return b;
  
              return gcd(b%a, a);
          }
  
  
          String n(){
              return in.next();
          }
  
          int ni() {
              return in.nextInt();
          }
  
          long nl() {
              return in.nextLong();
          }
  
          void pn(long zx) {
              out.println(zx);
          }
  
          void pn(String sz) {
              out.println(sz);
          }
  
          void pn(double dx){
              out.println(dx);
          }
  
          class Tuple {
              long x;
              long y;
  
              Tuple(long a, long b) {
                  x = a;
                  y = b;
              }
          }
  
      }
  
      static class InputReader {
          private InputStream stream;
          private byte[] buf = new byte[1024];
          private int curChar;
          private int numChars;
  
          public InputReader(InputStream stream) {
              this.stream = stream;
          }
  
          public int read() {
              if (numChars == -1) {
                  throw new UnknownError();
              }
              if (curChar >= numChars) {
                  curChar = 0;
                  try {
                      numChars = stream.read(buf);
                  } catch (IOException e) {
                      throw new UnknownError();
                  }
                  if (numChars <= 0) {
                      return -1;
                  }
              }
              return buf[curChar++];
          }
  
          public int nextInt() {
              return Integer.parseInt(next());
          }
  
          public long nextLong() {
              return Long.parseLong(next());
          }
  
          public String next() {
              int c = read();
              while (isSpaceChar(c)) {
                  c = read();
              }
              StringBuffer res = new StringBuffer();
              do {
                  res.appendCodePoint(c);
                  c = read();
              } while (!isSpaceChar(c));
  
              return res.toString();
          }
  
          private boolean isSpaceChar(int c) {
              return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
          }
  
      }
  }