#include <bits/stdc++.h>
using namespace std;
int main() {
  long double n, U;
  cin >> n >> U;
  vector<long double> V;
  for (int i = 0; i < n; i++) {
    long double a;
    cin >> a;
    V.push_back(a);
  }
  long double max = -1.0;
  for (int i = 0; i < (n - 2); i++) {
    int d = upper_bound(V.begin(), V.end(), V[i] + U) - V.begin();
    d--;
    if (d - i < 2) continue;
    long double s1 = V[d] - V[i + 1];
    long double s2 = V[d] - V[i];
    long double s3 = s1 / s2;
    if (s3 > max) {
      max = s3;
    }
  }
  printf("%0.11Lf\n", max);
  return 0;
}
