#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(0);
  int n, u;
  cin >> n >> u;
  double ans = -1.00;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int idx = 2;
  for (int i = 0; i < n - 2; i++) {
    while (arr[idx] - arr[i] <= u && idx < n) {
      idx++;
    }
    idx--;
    if (i + 1 < idx) {
      double x = (arr[idx] - arr[i + 1] * 1.00) / (arr[idx] - arr[i] * 1.00);
      ans = max(ans, x);
    }
  }
  printf("%.15lf", ans);
  return 0;
}
