#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, u;
  cin >> n >> u;
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  long double best = -1.0;
  for (int i = 0; i < n - 2; i++) {
    int k = upper_bound(A.begin(), A.end(), A[i] + u) - 1 - A.begin();
    if (k - i < 2) continue;
    best = max(best, (A[k] - A[i + 1]) / (long double)(A[k] - A[i]));
  }
  cout << setprecision(10) << best << "\n";
}
