#include <bits/stdc++.h>
using namespace std;
long double PI = acosl(-1);
bool compare_int(int a, int b) { return (a > b); }
bool compare_string(string a, string b) { return a.size() < b.size(); }
bool compare_pair(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second == b.second)
    return a.first < b.first;
  else
    return (a.second > b.second);
}
bool cmp(pair<string, int> x, pair<string, int> y) {
  return (x.second < y.second);
}
void NA() {
  printf("NO\n");
  exit(0);
}
void YA() {
  printf("YES\n");
  exit(0);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, u;
  cin >> n >> u;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int idx1 = 0, idx2 = 0;
  double Max = -1;
  while (idx1 < n) {
    idx2 = max(idx1, idx2);
    while (idx2 + 1 < n and a[idx2 + 1] - a[idx1] <= u) idx2++;
    if (idx1 + 1 < idx2) {
      double d = 1.0 * (a[idx2] - a[idx1 + 1]) / (a[idx2] - a[idx1]);
      Max = max(Max, d);
    }
    idx1++;
  }
  cout << setprecision(18) << fixed << Max << endl;
}
