#include <bits/stdc++.h>
using namespace std;
double val(int x, int y, int z) {
  return ((double)(z - y) * 1.0) / ((double)(z - x) * 1.0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long u;
  cin >> n >> u;
  long long ar[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  double ma = -1.0;
  for (int i = 0; i < n; i++) {
    int l = i + 2, r = n - 1;
    while (l <= r) {
      int mid = l + (r - l) / 2;
      if (ar[i] + u >= ar[mid]) {
        l = mid + 1;
        ma = max(val(ar[i], ar[i + 1], ar[mid]), ma);
      } else
        r = mid - 1;
    }
  }
  printf("%0.9lf\n", ma);
  return 0;
}
