#include <bits/stdc++.h>
using namespace std;
int main() {
  double T = 1;
  while (T--) {
    double u;
    int n, i, j;
    double f = -1;
    cin >> n >> u;
    double ar[n];
    for (i = 0; i < n; i++) cin >> ar[i];
    j = 0;
    for (i = 0; i < n; i++) {
      while (j < n && ar[j] - ar[i] <= u) j++;
      j--;
      if (j > i + 1) {
        f = max(f, double((ar[j] - ar[i + 1]) / (ar[j] - ar[i])));
      }
    }
    std::cout << std::setprecision(9) << f << '\n';
  }
}
