#include <bits/stdc++.h>
using namespace std;
long long n, a[100005], i = 0, j = 0, u, k;
long double cnt, mx = -1;
int main(void) {
  for (cin >> n >> u; i < n; i++) {
    cin >> a[i];
  }
  k = 2;
  for (i = 0; i < n - 2 && k < n; i++) {
    while ((a[k] - a[i]) <= u && k < n) k++;
    k--;
    if (k > i + 1) {
      cnt = (a[k] - a[i + 1]) / (double)(a[k] - a[i]);
      if (cnt > mx) mx = cnt;
    }
  }
  cout << fixed << setprecision(11) << mx;
  return 0;
}
