#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, U;
  long double ans = -1.0;
  cin >> n >> U;
  vector<long double> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  for (long long int i = 0; i < n - 2; i++) {
    long long int ind =
        upper_bound(v.begin() + i + 2, v.end(), U + v[i]) - v.begin();
    ind--;
    if (ind <= i + 1) continue;
    long double temp = (v[ind] - v[i + 1]) / (v[ind] - v[i]);
    ans = max(ans, temp);
  }
  cout << fixed << setprecision(20) << ans;
}
