#include <bits/stdc++.h>
using namespace std;
int e[100000];
int main() {
  int n, u;
  scanf("%d %d", &n, &u);
  for (int i = 0; i < n; ++i) scanf("%d", &e[i]);
  double ans = -1;
  int k = 1;
  for (int i = 0; i < n - 2; ++i) {
    while (k < n && e[k] - e[i] <= u) ++k;
    if (k > i + 2 && ((e[k - 1] - e[i + 1] + 0.0) / ((e[k - 1] - e[i])) > ans))
      ans = (e[k - 1] - e[i + 1] + 0.0) / ((e[k - 1] - e[i]));
  }
  cout << setprecision(20) << ans << '\n';
}
