#include <bits/stdc++.h>
using namespace std;
void solve(int index = 0) {
  long long int n;
  long long int u;
  cin >> n >> u;
  vector<long long int> v(n);
  for (auto &c : v) cin >> c;
  long double ans = -1;
  for (long long int i = 0; i < n; i++) {
    long long int e = v[i];
    e += u;
    auto it = upper_bound(v.begin(), v.end(), e);
    if (it == v.begin()) continue;
    it--;
    long long int k = it - v.begin();
    long long int j = i + 1;
    if (!(j > i && k > j)) continue;
    long double ee = (long double)(v[k] - v[j]) / (long double)(v[k] - v[i]);
    ans = max(ans, ee);
  }
  cout << setprecision(18) << ans << "\n";
}
void multi_solve() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
