#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 100;
int n;
long long U;
long long e[MAX];
long long bin_search(long long x) {
  int l = 0;
  int r = n;
  while (r - l >= 1) {
    int i = (l + r) >> 1;
    if (e[i] == x)
      return i;
    else if (e[i] < x)
      l = i + 1;
    else
      r = i;
  }
  if (e[l] > x) {
    for (int i = l; i >= 0; i--) {
      if (e[i] <= x) return i;
    }
  } else if (e[l] == x)
    return l;
  else {
    for (int i = l; i < n; i++) {
      if (e[i] > x) return i - 1;
    }
  }
}
void div(long long a, long long b, long long *num) {
  for (int i = 0; i < 20; i++) {
    num[i] = a / b;
    a = a % b;
    a *= 10;
  }
}
int main() {
  scanf("%d%lld", &n, &U);
  for (int i = 0; i < n; i++) scanf("%lld", &e[i]);
  long long ans[100];
  memset(ans, 0, sizeof(ans));
  for (int i = 0; i < n; i++) {
    int num;
    if (e[i] + U >= e[n - 1])
      num = n - 1;
    else
      num = bin_search(e[i] + U);
    if (num - i + 1 >= 3) {
      long long tmp[100];
      div(e[num] - e[i + 1], e[num] - e[i], tmp);
      for (int j = 0; j < 20; j++) {
        if (tmp[j] > ans[j]) {
          for (int k = 0; k < 20; k++) ans[k] = tmp[k];
          break;
        } else if (tmp[j] == ans[j])
          continue;
        else
          break;
      }
    }
  }
  int flag = 0;
  for (int i = 0; i < 20; i++) {
    if (ans[i] != 0) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    printf("-1\n");
  } else {
    printf("%lld.", ans[0]);
    for (int i = 1; i < 20; i++) printf("%lld", ans[i]);
    printf("\n");
  }
  return 0;
}
