#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, u, i, k1;
  cin >> n >> u;
  int a[n];
  double k = -1;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n - 2; i++) {
    k1 = upper_bound(a, a + n, (a[i] + u)) - a;
    k1--;
    if (k1 < i + 2) continue;
    k = max(k, (a[k1] - a[i + 1]) / ((double)(a[k1] - a[i])));
  }
  cout << fixed << setprecision(10) << k;
  return 0;
}
