#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << '\n';
  err(++it, args...);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, U;
  cin >> n >> U;
  std::vector<long long int> E(n);
  long double ans = -1;
  for (long long int i = 0; i < n; ++i) {
    cin >> E[i];
  }
  for (long long int i = 0; i <= n - 3; ++i) {
    long long int j = i + 1;
    long long int Ekmax = U + E[i];
    if (E[i + 2] > U + E[i]) {
      continue;
    }
    long long int k = upper_bound(E.begin(), E.end(), Ekmax) - E.begin();
    k--;
    if (k <= j) {
      continue;
    }
    long double Ei = E[i];
    long double Ej = E[j];
    long double Ek = E[k];
    long double curans = (Ek - Ej) / (Ek - Ei);
    ans = max(ans, curans);
  }
  cout << setprecision(9) << ans << '\n';
  return 0;
}
