#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e5 + 5;
inline long long power(long long a, long long b) {
  long long x = 1;
  a = a % mod;
  while (b) {
    if (b & 1) x = (x * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return x;
}
inline long long inv(long long a) { return power(a, mod - 2); }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long n, u;
long long e[100005];
double maxx = -1.0;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> u;
  for (int i = 0; i < n; i++) cin >> e[i];
  cout << setprecision(12);
  cout << fixed;
  for (int i = 0; i < n; i++) {
    int j = lower_bound(e, e + n, e[i] + u) - e;
    if (j == n) j--;
    if (e[j] > e[i] + u) j--;
    if (j > i + 1) {
      double xx = (double)(e[j] - e[i + 1]) / ((double)(e[j] - e[i]));
      maxx = max(xx, maxx);
    }
  }
  cout << maxx << endl;
  return 0;
}
