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.util.Arrays;
  import java.util.InputMismatchException;
  import java.io.IOException;
  import java.io.InputStream;
  
  /** Built using CHelper plug-in Actual solution is at the top */
  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 {
      public void solve(int testNumber, FastReader in, PrintWriter out) {
        int n = in.nextInt();
        long[] a = in.nextLongArray(n);
        if (n == 1) {
          out.println(1);
          return;
        }
        long[] b = new long[n - 1];
        for (int i = 1; i < n; ++i) {
          b[i - 1] = Math.abs(a[i] - a[i - 1]);
        }
        final SegmentTreeL segmentTree =
            new SegmentTreeL(b) {
  
              public long merge(long c1, long c2) {
                return NT.gcd(c1, c2);
              }
  
              public long incorrectCondition() {
                return 0;
              }
            };
        int ans = 0;
        for (int i = 0, j = 0; i < n; ++i) {
          if (j < i) {
            j = i;
          }
          long cur = i < j ? segmentTree.getRangeOp(i, j - 1) : 0;
          long _gcd;
          while (j < n - 1 && (_gcd = NT.gcd(cur, b[j])) != 1) {
            ++j;
            cur = _gcd;
          }
          ans = Math.max(ans, j - i);
        }
        out.println(ans + 1);
      }
    }
  
    static interface PReader {}
  
    abstract static class SegmentTreeL {
      long[] seg;
      long[] a;
      int size;
      int N;
      int MIN = Integer.MIN_VALUE;
  
      public SegmentTreeL(long[] a) {
        this.N = a.length;
        size = 4 * N;
        seg = new long[size];
        Arrays.fill(seg, MIN);
        this.a = a;
        build(0, N - 1, 0);
      }
  
      public SegmentTreeL(int n) {
        N = n;
        size = 4 * N;
        seg = new long[size];
        a = new long[n];
        build(0, N - 1, 0);
      }
  
      private void build(int s, int e, int c) {
        if (s == e) {
          seg[c] = a[s];
          return;
        }
        int m = (s + e) >>> 1;
        build(s, m, 2 * c + 1);
        build(m + 1, e, 2 * c + 2);
        seg[c] = merge(seg[2 * c + 1], seg[2 * c + 2]);
      }
  
      public abstract long merge(long c1, long c2);
  
      public abstract long incorrectCondition();
  
      public long getRangeOp(int l, int r) {
        return getRangeOp(0, N - 1, 0, l, r);
      }
  
      private long getRangeOp(int s, int e, int c, int l, int r) {
        if (s > e || l > r || l > e || r < s) return incorrectCondition();
        if (s == e) {
          return seg[c];
        }
        if (s >= l && e <= r) {
          return seg[c];
        }
        int m = (s + e) >>> 1;
        return merge(getRangeOp(s, m, 2 * c + 1, l, r), getRangeOp(m + 1, e, 2 * c + 2, l, r));
      }
    }
  
    static class NT {
      public static long gcd(long a, long b) {
        a = Math.abs(a);
        b = Math.abs(b);
        while (b > 0) {
          long c = a;
          a = b;
          b = c % b;
        }
        return a;
      }
    }
  
    static class FastReader implements PReader {
      private final InputStream stream;
      private final byte[] buf = new byte[8192];
      private int curChar;
      private int pnumChars;
  
      public FastReader(InputStream stream) {
        this.stream = stream;
      }
  
      public String next() {
        return nextString();
      }
  
      public String nextString() {
        int c = pread();
        while (isSpaceChar(c)) c = pread();
        StringBuilder res = new StringBuilder();
        do {
          res.appendCodePoint(c);
          c = pread();
        } while (!isSpaceChar(c));
        return res.toString();
      }
  
      private int pread() {
        if (pnumChars == -1) {
          throw new InputMismatchException();
        }
        if (curChar >= pnumChars) {
          curChar = 0;
          try {
            pnumChars = stream.read(buf);
          } catch (IOException e) {
            throw new InputMismatchException();
          }
          if (pnumChars <= 0) {
            return -1;
          }
        }
        return buf[curChar++];
      }
  
      private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
      }
  
      public int nextInt() {
        int c = pread();
        while (isSpaceChar(c)) c = pread();
        int sgn = 1;
        if (c == '-') {
          sgn = -1;
          c = pread();
        }
        int res = 0;
        do {
          if (c == ',') {
            c = pread();
          }
          if (c < '0' || c > '9') {
            throw new InputMismatchException();
          }
          res *= 10;
          res += c - '0';
          c = pread();
        } while (!isSpaceChar(c));
        return res * sgn;
      }
  
      public long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++) {
          array[i] = nextLong();
        }
        return array;
      }
  
      public long nextLong() {
        int c = pread();
        while (isSpaceChar(c)) c = pread();
        int sgn = 1;
        if (c == '-') {
          sgn = -1;
          c = pread();
        }
        long res = 0;
        do {
          if (c < '0' || c > '9') {
            throw new InputMismatchException();
          }
          res *= 10;
          res += c - '0';
          c = pread();
        } while (!isSpaceChar(c));
        return res * sgn;
      }
    }
  }
  