#include <bits/stdc++.h>
using namespace std;
int a[300001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int p, n, u, i;
  double stepen = -1;
  cin >> n >> u;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n - 2; i++) {
    if (a[i] + u >= a[n - 1]) {
      if (n - 1 > i + 1) {
        if (((double)a[n - 1] - (double)a[i + 1]) / ((double)a[n - 1] - a[i]) >
            stepen)
          stepen =
              ((double)a[n - 1] - (double)a[i + 1]) / ((double)a[n - 1] - a[i]);
      }
    } else {
      p = upper_bound(a, a + n, a[i] + u) - a;
      if (p - 1 > i + 1) {
        if (((double)a[p - 1] - (double)a[i + 1]) / ((double)a[p - 1] - a[i]) >
            stepen)
          stepen =
              ((double)a[p - 1] - (double)a[i + 1]) / ((double)a[p - 1] - a[i]);
      }
    }
  }
  printf("%.10f", stepen);
  return 0;
}
