#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, i, u;
  cin >> n >> u;
  long long int a[n + 2];
  bool pos = false;
  double res = 0;
  for (i = 0; i < n + 1; ++i) {
    cin >> a[i];
  }
  int j = 0;
  for (int i = 0; i < n - 2; i++) {
    j = max(j, i + 2);
    while (j + 1 < n && a[j + 1] - a[i] <= u) j++;
    if (a[j] - a[i] <= u) {
      res = max(res, (double(a[j] - a[i + 1])) / (double(a[j] - a[i])));
      pos = true;
    }
  }
  if (pos)
    cout << fixed << setprecision(10) << res;
  else
    cout << "-1";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
