#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, u;
  cin >> n >> u;
  vector<int> v(n);
  long double ans = -1, temp = -1;
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n - 1; i++) {
    auto itr = lower_bound(v.begin() + i + 1, v.end(), v[i] + u);
    if (!binary_search(v.begin() + i, v.end(), v[i] + u)) itr--;
    int val = *itr;
    temp = ((long double)(val - v[i + 1])) / (val - v[i]);
    if (temp != 0) ans = max(ans, temp);
  }
  cout << setprecision(15) << fixed << ans;
}
