#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 10;
long double n, u;
vector<long double> a(N);
bool check(long long x, long long i) {
  if (a[x] - i < u)
    return 1;
  else
    return 0;
}
int32_t main() {
  cin >> n >> u;
  a.resize(n);
  long double ans = -1;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n - 2; i++) {
    long long temp = upper_bound(a.begin(), a.end(), a[i] + u) - a.begin();
    temp--;
    if (temp > i + 1) ans = max(ans, (a[temp] - a[i + 1]) / (a[temp] - a[i]));
  }
  cout << fixed << setprecision(15) << ans;
}
