#include <bits/stdc++.h>
using namespace std;
const int64_t MAXN = 1e6 + 5, mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int64_t n, u;
  cin >> n >> u;
  vector<int64_t> a(n);
  for (auto &it : a) cin >> it;
  long double ans = -1;
  for (int64_t i = 0; i < n - 2; i++) {
    int64_t l = 0, r = n;
    while (r - l > 1) {
      int64_t m = (l + r) / 2;
      if (a[i] + u >= a[m])
        l = m;
      else
        r = m;
    }
    if (l - i < 2) continue;
    ans = max(ans, (long double)(a[l] - a[i + 1]) / (a[l] - a[i]));
  }
  printf("%.12LF\n", ans);
}
