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.io.OutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.PrintWriter;
  import java.io.PrintStream;
  import java.util.Arrays;
  import java.util.Random;
  import java.io.InputStream;
  
  /**
   * Built using CHelper plug-in
   * Actual solution is at the top
   *
   * @author sarthakmanna
   */
  public class Main {
      public static void main(String[] args) {
          InputStream inputStream = System.in;
          OutputStream outputStream = System.out;
          FastReader in = new FastReader(inputStream);
          PrintWriter out = new PrintWriter(outputStream);
          DIntegersHaveFriends solver = new DIntegersHaveFriends();
          int testCount = Integer.parseInt(in.next());
          for (int i = 1; i <= testCount; i++)
              solver.solve(i, in, out);
          out.close();
      }
  
      static class DIntegersHaveFriends {
          final static Helper hp = new Helper();
  
          public void solve(int testNumber, FastReader in, PrintWriter out) {
              int i, j, k;
              // Theory: if a ~ b (mod m) then m | abs(a - b)
              // http://www.math.toronto.edu/rosent/Mat246Y/congruencies.htm
  
              int N = in.nextInt();
              long[] A = in.getLongArray(N);
  
              long[] D = new long[N - 1];
              for (i = 0; i < N - 1; ++i) D[i] = Math.abs(A[i + 1] - A[i]);
              //System.err.println(Arrays.toString(D));
  
              SegmentTree segT = new SegmentTree(D, 0, 0) {
                  public long nodeToNode(long a, long b) {
                      return hp.gcd(a, b);
                  }
              };
              //System.err.println(segT);
  
              int max = 0, p = 0;
              for (i = 0; i < N - 1; ++i) {
                  while (p < N - 1 && segT.rangeQuery(i, p) != 1) ++p;
                  max = Math.max(max, p - i);
              }
              out.println(max + 1);
          }
  
      }
  
      static class FastReader {
          static final int BUFSIZE = 1 << 20;
          static byte[] buf;
          static int index;
          static int total;
          static InputStream in;
  
          public FastReader(InputStream is) {
              try {
                  in = is;
                  buf = new byte[BUFSIZE];
              } catch (Exception e) {
              }
          }
  
          private int scan() {
              try {
                  if (index >= total) {
                      index = 0;
                      total = in.read(buf);
                      if (total <= 0)
                          return -1;
                  }
                  return buf[index++];
              } catch (Exception | Error e) {
                  System.err.println(e.getMessage());
                  return 13 / 0;
              }
          }
  
          public String next() {
              int c;
              for (c = scan(); c <= 32; c = scan()) ;
              StringBuilder sb = new StringBuilder();
              for (; c > 32; c = scan())
                  sb.append((char) c);
              return sb.toString();
          }
  
          public int nextInt() {
              int c, val = 0;
              for (c = scan(); c <= 32; c = scan()) ;
              boolean neg = c == '-';
              if (c == '-' || c == '+')
                  c = scan();
              for (; c >= '0' && c <= '9'; c = scan())
                  val = (val << 3) + (val << 1) + (c & 15);
              return neg ? -val : val;
          }
  
          public long nextLong() {
              int c;
              long val = 0;
              for (c = scan(); c <= 32; c = scan()) ;
              boolean neg = c == '-';
              if (c == '-' || c == '+')
                  c = scan();
              for (; c >= '0' && c <= '9'; c = scan())
                  val = (val << 3) + (val << 1) + (c & 15);
              return neg ? -val : val;
          }
  
          public long[] getLongArray(int size) {
              long[] ar = new long[size];
              for (int i = 0; i < size; ++i) ar[i] = nextLong();
              return ar;
          }
  
      }
  
      static class Helper {
          public final long MOD;
          public final int MAXN;
          final Random rnd;
  
          public Helper() {
              MOD = 1000_000_007;
              MAXN = 1000_006;
              rnd = new Random();
          }
  
          public Helper(long mod, int maxn) {
              MOD = mod;
              MAXN = maxn;
              rnd = new Random();
          }
  
          public long gcd(long a, long b) {
              return b == 0 ? a : gcd(b, a % b);
          }
  
      }
  
      static class SegmentTree {
          private int N;
          private long[] tree;
          private long[] lazy;
          public final long DEFAULT_NODE;
          public final long DEFAULT_LAZY;
  
          public SegmentTree(long[] ar, long def_node, long def_lazy) {
              DEFAULT_NODE = def_node;
              DEFAULT_LAZY = def_lazy;
              N = 1;
              while (N < ar.length) N <<= 1;
              tree = new long[N * 2 - 1];
              Arrays.fill(tree, DEFAULT_NODE);
              lazy = new long[N * 2 - 1];
              Arrays.fill(lazy, DEFAULT_LAZY);
  
              for (int i = 0; i < ar.length; ++i) tree[i + N - 1] = ar[i];
              for (int i = N - 2; i >= 0; --i) {
                  tree[i] = nodeToNode(tree[i * 2 + 1], tree[i * 2 + 2]);
              }
          }
  
          public long nodeToNode(long a, long b) {
              return a + b;
          }
  
          public long lazyToLazy(long a, long b) {
              return a + b;
          }
  
          public long lazyToNode(long a, int l, int r) {
              return a * (r - l + 1);
          }
  
          public void pushDown(int i, int l, int r) {
              tree[i] = nodeToNode(tree[i], lazyToNode(lazy[i], l, r));
              if (i * 2 + 1 < tree.length) {
                  lazy[i * 2 + 1] = lazyToLazy(lazy[i * 2 + 1], lazy[i]);
                  lazy[i * 2 + 2] = lazyToLazy(lazy[i * 2 + 2], lazy[i]);
              }
              lazy[i] = DEFAULT_LAZY;
          }
  
          public long rangeQuery(int l, int r) {
              return query(0, 0, N - 1, l, r);
          }
  
          private long query(int i, int l, int r, int ql, int qr) {
              pushDown(i, l, r);
              int mid = l + r >> 1, i2 = i << 1;
              if (l > qr || r < ql) return DEFAULT_NODE;
              else if (l >= ql && r <= qr) return tree[i];
              else {
                  return nodeToNode(query(i2 + 1, l, mid, ql, qr),
                          query(i2 + 2, mid + 1, r, ql, qr));
              }
          }
  
          public String toString() {
              return "SegTree = " + Arrays.toString(tree) + ", " + Arrays.toString(lazy);
          }
  
      }
  }
  
  