#include <bits/stdc++.h>
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  bool first = true;
  os << "[";
  for (auto i : v) {
    if (!first) os << ", ";
    os << i;
    first = false;
  }
  return os << "]";
}
const int MAX = 100010;
int n, u, e[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> u;
  cout << fixed << setprecision(20);
  for (int i = 0; i < n; ++i) {
    cin >> e[i];
  }
  int l = 0, r = 0, tot = 0;
  long double ans1 = -1.0;
  while (l < n) {
    tot = 0;
    while (r < n and (e[r] - e[l]) <= u) {
      ++r;
    }
    if ((r - l) > 2) {
      int t = r - 1;
      ans1 = max(ans1,
                 (long double)(1. * (e[t] - e[l + 1])) / (1. * (e[t] - e[l])));
    }
    ++l;
  }
  cout << ans1;
  return 0;
}
