#include <bits/stdc++.h>
using namespace std;
double n, x, u;
double ans = -1 * 1.0000000000;
vector<double> e;
double binarylaura(double a, double lol) {
  long long low = a + 1, high = e.size() - 1, mid, tmp = -1;
  while (low <= high) {
    mid = (low + high) >> 1;
    if (e[mid] - e[lol] <= u) {
      tmp = mid;
      low = mid + 1;
    } else {
      high = mid - 1;
    }
  }
  return (tmp == -1) ? -1.00 : e[tmp] * 1.0000000000;
}
int main() {
  cin >> n >> u;
  for (int i = 0; i < n; i++) {
    double x;
    cin >> x;
    e.push_back(x * 1.0000000000);
  }
  for (int i = 1; i < e.size(); i++) {
    double it = binarylaura(i, i - 1);
    (it == -1) ? 0
               : ans = max(ans * 1.0000000000,
                           (it - e[i]) / (it - e[i - 1]) * 1.0000000000);
  }
  cout << std::fixed;
  cout.precision(10);
  cout << ans << endl;
  return 0;
}
