#include <bits/stdc++.h>
using namespace std;
const int sz = (int)1e6 + 6;
int a[sz];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, u;
  cin >> n >> u;
  for (int i = 0; i < n; i++) cin >> a[i];
  double ans = -1;
  for (int i = 1; i < n - 1; i++) {
    int pos = (upper_bound(a, a + n, u + a[i - 1]) - a) - 1;
    double t = (double)(a[pos] - a[i]) / (double)(a[pos] - a[i - 1]);
    if (pos == i)
      continue;
    else
      ans = max(t, ans);
  }
  cout << fixed << setprecision(10);
  cout << ans;
}
