#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  long long n, u, i = 0, k = 2;
  cin >> n >> u;
  long double p = -1;
  vector<long double> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (i = 0; i < n - 2; i++) {
    if (k < i + 2) {
      k = i + 2;
    }
    while (k < n - 1 && v[k + 1] - v[i] <= u) {
      k++;
    }
    if (v[k] - v[i] > u) continue;
    long double e = (v[k] - v[i + 1]) / (v[k] - v[i]);
    p = max(p, e);
  }
  cout << fixed << setprecision(20) << p << endl;
}
