#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, u, a[100005];
  while (cin >> n >> u) {
    for (int i = 1; i <= n; i++) cin >> a[i];
    double ans = -1;
    for (int i = 2; i <= n; i++) {
      long long int lo = i + 1;
      long long int hi = n;
      long long int ek = i;
      do {
        long long int mid = (lo + hi) / 2;
        if (a[mid] - a[i - 1] <= u) {
          ek = mid;
          lo = mid + 1;
        } else {
          hi = mid - 1;
        }
      } while (lo <= hi);
      if (ek == i) {
        continue;
      }
      double xx = ((double)a[ek] - a[i]) / (double(a[ek] - a[i - 1]));
      ans = max(ans, xx);
    }
    cout.precision(10);
    cout << ans << endl;
  }
  return 0;
}
