#include <bits/stdc++.h>
using namespace std;
long long ans;
long long n, m, l, r, t, a[200000], b, prevb;
long long i, j, k;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void solution() {
  cin >> n;
  ;
  if (n == 1) {
    cin >> b;
    ;
    cout << 1 << "\n";
    ;
  } else {
    n--;
    ans = 0;
    cin >> prevb;
    ;
    for (i = 0; i < n; i++) {
      cin >> b;
      a[i] = abs(prevb - b);
      prevb = b;
    }
    i = 0;
    while ((a[i] == 1) && (i < n)) {
      i++;
    }
    if (i < n) {
      t = 2;
      m = a[i];
    } else {
      t = 1;
    }
    for (i++; i < n; i++) {
      m = gcd(m, a[i]);
      if (m == 1) {
        if (t > ans) {
          ans = t;
        }
        while ((a[i] == 1) && (i < n)) {
          i++;
        }
        if (i < n) {
          t = 2;
          m = a[i];
        } else {
          t = 1;
          break;
        }
        l = gcd(m, a[i - 1]);
        for (j = i - 2; l != 1; j--) {
          m = l;
          l = gcd(m, a[j]);
          t++;
        }
      } else {
        t++;
      }
    }
    if (t > ans) {
      ans = t;
    }
    cout << ans << "\n";
    ;
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long ttt;
  cin >> ttt;
  ;
  while (ttt--) {
    solution();
  }
  return 0;
}
