#include <bits/stdc++.h>
using namespace std;
int visited[100];
int main() {
  long long n, u;
  cin >> n >> u;
  long long E[n];
  for (int i = 0; i < n; i++) cin >> E[i];
  double ans = -1;
  std::cout << setprecision(18);
  std::cout << fixed;
  for (int i = 0; i < n; i++) {
    long long q = E[i];
    int z = upper_bound(E, E + n, q + u) - E;
    if (z - 1 - i <= 1) continue;
    double as = double(E[z - 1] - E[i + 1]);
    as /= E[z - 1] - E[i];
    ans = max(ans, as);
  }
  cout << ans;
}
