#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int index = lower_bound(e, e + k, find) - e;
		if (index < n && e[index] != find) index--;
		if (index < k - 1 && e[k] - e[index] <= u) {
			ll denom = e[k] - e[index];
			ll nom = e[k] - e[index + 1];

			found = true;
			double eta = (nom*1.0) / denom;
			maxEta = max(eta, maxEta);
		}
	}

	if (found) cout << fixed << setprecision(10) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int index = lower_bound(e, e + n, find) - e;
		if (index != k && index != k - 1) {
			ll denom = e[k] - e[index];
			ll nom = e[k] - e[index + 1];

			found = true;
			double eta = (nom*1.0) / denom;
			maxEta = max(eta, maxEta);
		}
	}

	if (found) cout << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		if (e[k] > u) {
			ll find = e[k] - u;
			int index = lower_bound(e, e + n, find) - e;
			if (index < k - 1 && e[k] - e[index] <= u) {
				ll denom = e[k] - e[index];
				ll nom = e[k] - e[index + 1];

				found = true;
				double eta = (nom*1.0) / denom;
				maxEta = max(eta, maxEta);
			}
		}
	}

	if (found) cout << fixed << setprecision(10) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	long double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int i = lower_bound(e, e + n, find) - e;
		if (i < k - 1 && e[k] - e[i] <= u) {
			ll denom = e[k] - e[i];
			ll nom = e[k] - e[i + 1];

			found = true;
			long double eta = (nom*1.0) / (denom*1.0);
			maxEta = max(eta, maxEta);
		}
	}

	if (found) cout << fixed << setprecision(15) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int index = lower_bound(e, e + k, find) - e;
		if (e[index] != e[k] - u) index--;
		if (index < k - 1) {
			ll denom = e[k] - e[index];
			ll nom = e[k] - e[index + 1];

			found = true;
			double eta = (nom*1.0) / denom;
			maxEta = max(eta, maxEta);
		}
	}

	if (found) cout << fixed << setprecision(10) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int index = lower_bound(e, e + k, find) - e;
		if (index < k - 1) {
			ll denom = e[k] - e[index];
			ll nom = e[k] - e[index + 1];

			found = true;
			double eta = (nom*1.0) / denom;
			maxEta = max(eta, maxEta);
		}
	}

	if (found) cout << fixed << setprecision(10) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	double maxEta = -1;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int i = lower_bound(e, e + n, find) - e;
		if (i < k - 1 && e[k] - e[i] <= u) {
			ll denom = e[k] - e[i];
			ll nom = e[k] - e[i + 1];

			found = true;
			double eta = (nom*1.0) / (denom*1.0);
			maxEta = max(eta, maxEta);
		}
	}

	if (found) cout << fixed << setprecision(10) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <bitset>
#include <math.h>
#include <iomanip>

using namespace std;

#define EPS 1e-9
#define PI 3.1415926535897932384626433832795028841971
#define INF 2000000000
#define OO 0x7fffffff
#define OOO 1.7e308
#define ll long long
#define ull unsigned long long
#define lp(i,n) for(int i=0;i<n;i++)
#define rep(i,j,n) for(int i=j;i<n;i++)
#define clr(memo, j) memset(memo, j, sizeof memo)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define All(a) a.begin(), a.end()
#define even(x) x%2==0
#define odd(x) x%2!=0
#define rd(x) scanf("%d", &x)
#define pt(x) printf("%d", x)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vii> vvii;

bool comp(ull x, ull y) { return x > y; }

int dx[] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };

class UnionFind {
private: vi p, rank;
public:
	UnionFind(int N) {
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;
	}

	int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
	bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
			}
			else {
				p[x] = y;
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}
};

/*
class SegmentTree {
private:
	vector<pair<ll, ll> > st;
	vll a;
	int n;
	int left(int p) { return p << 1; }
	int right(int p) { return (p << 1) + 1; }

	void build(int p, int L, int R) {
		if (L == R) st[p] = make_pair(a[L], a[L]);
		else {
			build(left(p), L, (L + R) / 2);
			build(right(p), (L + R) / 2 + 1, R);
			pair<ll, ll> p1 = st[left(p)], p2 = st[right(p)];
			if (R - L == 1) st[p] = make_pair(p1.first, p2.first);
			else {
				pair<ll, pair<ll, ll> > minuses[] = { make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second)), make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first)), make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second)), make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first)), make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second)), make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second)) };
				sort(minuses, minuses + 6);
				st[p] = minuses[0].second;
			}
		}
	}

	pair<ll, ll> rmq(int p, int L, int R, int i, int j) {
		if (i > R || j < L) return make_pair(-1LL, -1LL);
		if (L >= i && R <= j) {
			if (R == L) return make_pair(a[R], -1LL);
			return st[p];
		}

		pair<ll, ll> p1 = rmq(left(p), L, (L + R) / 2, i, j);
		pair<ll, ll> p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);

		if (p1.first == -1) return p2;
		if (p2.first == -1) return p1;
		if (R - L == 1) return make_pair(a[L], a[R]);
		else {
			pair<ll, pair<ll, ll> > minuses[6];
			if (p1.second != -1) {
				minuses[0] = make_pair(abs(p1.first - p1.second), make_pair(p1.first, p1.second));
				minuses[1] = make_pair(abs(p1.second - p2.first), make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(abs(p1.second - p2.second), make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}
			else {
				minuses[0] = make_pair(1000000009LL, make_pair(p1.first, p1.second));
				minuses[1] = make_pair(1000000009LL, make_pair(p1.second, p2.first));
				if (p2.second != -1) minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
				else minuses[2] = make_pair(1000000009LL, make_pair(p1.second, p2.second));
			}

			minuses[3] = make_pair(abs(p1.first - p2.first), make_pair(p1.first, p2.first));

			if (p2.second != -1) {
				minuses[4] = make_pair(abs(p1.first - p2.second), make_pair(p1.first, p2.second));
				minuses[5] = make_pair(abs(p2.first - p2.second), make_pair(p2.first, p2.second));
			}
			else {
				minuses[4] = make_pair(LLONG_MAX, make_pair(p1.first, p2.second));
				minuses[5] = make_pair(LLONG_MAX, make_pair(p2.first, p2.second));
			}

			sort(minuses, minuses + 6);
			return minuses[0].second;
		}
	}

public:
	SegmentTree(const vll &_a) {
		a = _a;
		n = a.size();
		st.assign(4 * n, make_pair(INF, INF));
		build(1, 0, n - 1);
	}

	pair<ll, ll> rmq(int i, int j) { return rmq(1, 0, n - 1, i, j); }
};

class FenwickTree {
private: vi ft;
public:
	FenwickTree(int n) {
		ft.assign(n + 1, 0);
	}

	int LSOne(int S) { return (S & (-S)); }

	int rsq(int b) {
		int sum = 0;
		for (; b > 0; b -= LSOne(b)) sum += ft[b];
		return sum;
	}

	int rsq(int a, int b) {
		return rsq(b) - ((a == 1) ? 0 : rsq(a - 1));
	}

	int get(int i) { return ft[i]; }

	void adjust(int k, int v) {
		for (; k < ft.size(); k += LSOne(k)) ft[k] += v;
	}
};
*/

ll gcd(ll a, ll b) {
	return b ? gcd(b, a%b) : a;
}

vector<int> getdividors(int n) {
	vector<int> dividors;
	int i;
	for (i = 1; i*i<n; i++) {
		if (n % i == 0) {
			if (i != 1) dividors.push_back(i);
			dividors.push_back(n / i);
		}
	}
	if (i*i == n) dividors.push_back(i);
	return dividors;
}

bool palindrome(string s) {
	int len = s.length();
	lp(i, len / 2) if (s[i] != s[len - i - 1]) return false;

	return true;
}

ll C(ll n) {
	return n*(n - 1) / 2;
}

void solveA() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	bool two[500];
	lp(i, n) two[i] = false;
	bool can = true;

	lp(i, n - 1) {
		if (s[i] == '?' && s[i + 1] != '?') {
			if (i > 0 && s[i - 1] != '?' && s[i - 1] != s[i + 1]) two[i] = true;
		}
	}

	//lp(i, n) cout << (two[i] ? "true" : "false") << endl;

	can = false;
	lp(i, n) if (s[i] == '?' && two[i] == false) can = true;

	lp(i, n - 1) {
		if (s[i] != '?' && s[i] == s[i + 1]) can = false;
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void solveB() {
	int n, m;
	cin >> n >> m;
	char grid[100][100];
	lp(i, n) {
		lp(j, m) {
			cin >> grid[i][j];
		}
	}

	int matched[100][100];

	bool can = true;
	lp(i, n) {
		lp(j, m) {
			if (grid[i][j] == '#') {
				for (int k = 0; k < m; k++) {
					if (grid[i][k] == '#') matched[i][k]++;
				}
				for (int k = 0; k < n; k++) {
					if (grid[k][j] == '#') matched[k][j]++;
				}
			}
		}
	}

	lp(i, n) {
		bool foundFirst = false;
		int val = -1;
		lp(j, m) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	lp(j, m) {
		bool foundFirst = false;
		int val = -1;
		lp(i, n) {
			if (grid[i][j] == '#') {
				if (foundFirst && matched[i][j] != val) can = false;
				else if (!foundFirst) {
					foundFirst = true;
					val = matched[i][j];
				}
			}
		}
	}

	if (can) cout << "Yes" << endl;
	else cout << "No" << endl;
}

vector<int> factorize(ll n) {
	vector<int> factors;
	for (ll i = 2; i*i <= n; i++) {
		while (n%i == 0) factors.push_back(i), n /= i;
	}
	if (n > 1) factors.push_back(n);
	return factors;
}

void solveC() {
	int n;
	ll u;
	cin >> n >> u;

	ll e[100000 + 10];
	lp(i, n) cin >> e[i];

	long double maxEta = 0;
	bool found = false;

	for (int k = 2; k < n; k++) {
		ll find = e[k] - u;
		int i = lower_bound(e, e + n, find) - e;
		if (i < k - 1 && e[k] - e[i] <= u) {
			ll denom = e[k] - e[i];
			ll nom = e[k] - e[i + 1];

			found = true;
			long double eta = (nom*1.0) / (denom*1.0);
			if (eta - maxEta > 0) {
				maxEta = eta;
			}
		}
	}

	if (found) cout << fixed << setprecision(15) << maxEta << endl;
	else cout << -1 << endl;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.in", "r", stdin);
	//freopen("C:\\Users\\Wajdy\\Desktop\\A-small-attempt2.out", "w", stdout);

	//ios::sync_with_stdio(false);

	solveC();

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < ll > E ;

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        int x ; cin >> x;
        E.push_back(x);
    }

    double res = 0;
    bool ok = 0 ;

    int i = 0 , k = 2 ;

    while(k < n){

         if(E[k] - E[i] <= u){
              double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              ok = 1;
              res = max(res , ans) ;
              k++ ;
         }
         else i++ ;

         if(k - i < 2) k ++ ;
    }
    k = n - 1;
    while(k - i >= 2){
         if(E[k] - E[i] <= u){
              double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              ok = 1;
              res = max(res , ans) ;
         }
         i++ ;
    }

    if(!ok){
           cout << -1 << endl ;
           return 0 ;
    }

    cout << fixed << setprecision(9) << res << endl ;

    return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < ll > E ;

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        int x ; cin >> x;
        E.push_back(x);
    }

    double res = 0;
    bool ok = 0 ;

    int i = 0 , k = 2 ;

    while(k < n){

         if(E[k] - E[i] <= u){
              double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              ok = 1;
              res = max(res , ans) ;
              k++ ;
         }
         else i++ ;

         if(k - i < 2)
                k ++ ;
    }
    while(k - i >= 2){
         if(E[k] - E[i] <= u){
              double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              ok = 1;
              res = max(res , ans) ;
         }
         i++ ;
    }

    if(!ok){
           cout << -1 << endl ;
           return 0 ;
    }

    cout << fixed << setprecision(9) << res << endl ;

    return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < ll > E ;

bool check(double mid , int i , int k){
     ll temp = E[k] -  mid * (E[k] - E[i]) ;
     ll t = lower_bound(E.begin() , E.end() , temp) - E.begin() ;

     if(t == E.size()) return false ;

     return E[t] == temp && E[t] != E[k] && E[t] != E[i] ;
}

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        int x ; cin >> x;
        E.push_back(x);
    }

    double res = -1;

    int i = 0 , k = 2 ;

    while(k - i >= 2 && k < n){

         if(E[k] - E[i] <= u){
              double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              res = max(res , ans) ;
              k++ ;
         }
         else i++ ;

         if(k - i < 2 && k < n){
                k ++ ;
         }
    }

    if(res == -1){
           cout << -1 << endl ;
           return 0 ;
    }

    cout << fixed << setprecision(9) << res << endl ;

    return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < int > E ;

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        int x ; cin >> x;
        E.push_back(x);
    }

    int k = 0 ;

    int idx1 = -1 , idx2 = -1 , idx3 = -1 ;

    for(int i = 0 ; i < n ; i++){
         k = max(k , i) ;

         while(k + 1 < n && E[k + 1] - E[i] <= u){
             k ++ ;
         }
         if(k - i - 1 <= 0) continue ;

         int j = i + 1;
         if(idx1 == -1 || (E[k] - E[j]) * 1LL * (E[idx3] - E[idx1]) > (E[idx3] - E[idx2]) * 1LL * (E[k] - E[i]) ){
               idx1 = i ;
               idx2 = j ;
               idx3 = k ;
         }
    }

    if(idx1 == -1){
          cout << -1 << endl ;
          return 0 ;
    }

    cout << fixed << setprecision(20) << (double) (E[idx3] - E[idx2]) / (E[idx3] - E[idx1]) << endl ;

    return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < double > E ;

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        double x ; cin >> x;
        E.push_back(x);
    }

    double res = -1;
    int i = 0 , k = 2 ;

    while(k - i >= 2 && k < n){

         if((int)(E[k] - E[i]) <= u){
              double ans = (E[k] - E[i + 1])/(E[k] - E[i]) ;
              res = max(res , ans) ;
              k++ ;
         }
         else i++ ;

         if(k - i < 2 && k < n){
                k ++ ;
         }
    }

    if(res == -1){
           cout << -1 << endl ;
           return 0 ;
    }

    cout << fixed << setprecision(6) << res << endl ;

    return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < ll > E ;

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        int x ; cin >> x;
        E.push_back(x);
    }

    long double res = 0;
    bool ok = 0 ;

    int i = 0 , k = 2 ;

    while(k < n){

         if(E[k] - E[i] <= u){
              long double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              ok = 1;
              res = max(res , ans) ;
              k++ ;
         }
         else i++ ;

         if(k - i < 2) k ++ ;
    }
    k = n - 1;
    while(k - i >= 2){
         if(E[k] - E[i] <= u){
              long double ans = (E[k] - E[i + 1])/(1.0 * (E[k] - E[i])) ;
              ok = 1;
              res = max(res , ans) ;
         }
         i++ ;
    }

    if(!ok){
           cout << -1 << endl ;
           return 0 ;
    }

    cout << fixed << setprecision(21) << res << endl ;

    return 0;
}


#include <bits/stdc++.h>
typedef long long ll ;
using namespace std;

int n , u ;
vector < ll > E ;

int main(){

    ios::sync_with_stdio(false);

    cin >> n >> u ;

    for(int i = 0 ; i < n ; i++){
        ll x ; cin >> x;
        E.push_back(x);
    }

    double res = 0;
    bool ok = 0;
    int i = 0 , k = 2 ;

    while(k < n){

         if((E[k] - E[i]) <= u){
              double ans = (E[k] - E[i + 1])/( 1.0 * (E[k] - E[i]) )  ;
              res = max(res , ans) ;
              ok = 1;
              k++ ;
         }

         else i++ ;

         if(k - i < 2) k++ ;
    }

    if(!ok){
           cout << -1 << endl ;
           return 0 ;
    }

    cout << fixed << setprecision(10) << res << endl ;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=2;i<n;i++){
        int x=a[i]-u;
        if(x<0) x=0;
        if(a[i-2]<x) continue;
        int pos=lower_bound(s.begin(),s.end(),x) - s.begin();
        while(a[i]-s[pos]>u||a[i]==s[pos]) pos--;
        if(pos==i-1) pos--;
        if(pos<0) continue;
        ans=max(ans,(a[i]-s[pos+1])/1.0/(a[i]-s[pos]));
    }
    if(ans==-1) cout<<-1<<endl;
    else printf("%.9f\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=0;i<n-2;i++){
        int x=a[i],y=a[i+1];
        int pos=lower_bound(s.begin(),s.end(),x+u)-s.begin();
        if(pos==n) pos--;
        while(s[pos]-x>u) pos--;
        if(s[pos]<=x||s[pos]<=y) continue;
        ans=max(ans,(s[pos]-y)/1.0/(s[pos]-x));
    }
    if(ans==-1) cout<<-1<<endl;
    else printf("%.9f\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=2;i<n;i++){
        int x=a[i]-u;
        if(a[i-2]<x) continue;
        int pos=lower_bound(s.begin(),s.end(),x) - s.begin();
        while(a[i]-s[pos]>u) pos++;
        if(pos==i-1||pos==i) continue;
        if(pos<0) continue;
        ans=max(ans,(a[i]-s[pos+1])/1.0/(a[i]-s[pos]));
    }
    if(ans==-1) cout<<-1<<endl;
    else printf("%.9f\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=2;i<n;i++){
        int x=a[i]-u;
        if(a[i-2]<x) continue;
        int pos=lower_bound(s.begin(),s.end(),x) - s.begin();
        while(a[i]-s[pos]>u) pos++;
        if(pos==i-1) continue;
        if(pos<0) continue;
        ans=max(ans,(a[i]-s[pos+1])/1.0/(a[i]-s[pos]));
    }
    if(ans==-1) cout<<-1<<endl;
    else printf("%.9f\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=2;i<n;i++){
        int x=a[i]-u;
        if(x<0) x=0;
        if(a[i-2]<x) continue;
        int pos=lower_bound(s.begin(),s.end(),x) - s.begin();
        while(a[i]-s[pos]>u||a[i]==s[pos]) pos--;
        if(pos==i-1) pos--;
        if(pos<0) continue;
        ans=max(ans,(a[i]-s[pos+1])/1.0/(a[i]-s[pos]));
    }
    if(ans==-1) cout<<-1<<endl;
    else cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=2;i<n;i++){
        int x=a[i]-u;
        if(a[i-2]<x) continue;
        int pos=lower_bound(s.begin(),s.end(),x) - s.begin();
        while(a[i]-s[pos]>u) pos++;
        if(pos>=i-1||pos==n-1) continue;
        ans=max(ans,(a[i]-s[pos+1])/1.0/(a[i]-s[pos]));
    }
    if(ans==-1) cout<<-1<<endl;
    else printf("%.9f\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int a[100100];
vector<int>s;

int main()
{
    int n,u;
    cin>>n>>u;
    for(int i=0;i<n;i++) cin>>a[i],s.push_back(a[i]);
    double ans=-1;
    for(int i=2;i<n;i++){
        int x=a[i]-u;
        if(a[i-2]<x) continue;
        int pos=lower_bound(s.begin(),s.end(),x) - s.begin();
        while(a[i]-s[pos]>u) pos++;
        if(pos==i-1) continue;
        pos--;
        if(pos<0) continue;
        ans=max(ans,(a[i]-s[pos+1])/1.0/(a[i]-s[pos]));
    }
    if(ans==-1) cout<<-1<<endl;
    else printf("%.9f\n",ans);
    return 0;
}


#include<bits/stdc++.h>

#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)

#define si(a)           scanf("%d",&a)
#define sii(a,b)        scanf("%d %d",&a,&b)
#define siii(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define sl(a)           scanf("%lld",&a)
#define sll(a,b)        scanf("%lld %lld",&a,&b)
#define slll(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)

#define lli long long
#define m_p make_pair
#define p_b push_back

#define lim 10000000000
#define mod 100007
#define mx 100004
#define PI  3.141592654
using namespace std;

///** Direction Array **
//int dirx[]= {1,0,-1,0};
//int diry[]= {0,1,0,-1};

///*** Translator Functions**
//int ToInt(string s){int r = 0;stringstream sin(s);sin >> r;return r;}
//double ToDouble(string s) { double r = 0; stringstream sin(s); sin >> r; return r; }
//string ToString(int n)  {  string s;    stringstream convert;convert << n;s = convert.str();return s;}
///****My code goes from here***
vector<double> ans;
vector<int>v;
int a,b;
int ask(int x)
{
    int low=0,high=a-1;
    while(low<=high)
    {
        int mid=(low+high)/2;
        if(v[mid]>x){
            high=mid-1;
        }
        else{
            low=mid+1;
        }
    }
    return low-1;
}
int main()
{

    cin>>a>>b;

    for(int i=0; i<a; i++)
    {
        int x;
        cin>>x;
        v.p_b(x);
    }
    //sort(v.begin(),v.end());
    for(int i=0; i<a; i++)
    {
        int p=v[i]+b;
        int idx=ask(p);
        if(idx-i>=2&&idx<a)
        {
            double pp=v[i];
            double q=v[i+1];
            double r=v[idx];
            double tt=(r-q);
            tt=tt/(r-pp);
            ans.p_b(tt);
//            cout<<i<<endl;
//            printf("%.8f\n",tt);
        }

    }
    sort(ans.begin(),ans.end());
    if(ans.size()==0) cout<<"-1"<<endl;
    else printf("%.9f\n",ans[ans.size()-1]);

}


#include<bits/stdc++.h>

#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)

#define si(a)           scanf("%d",&a)
#define sii(a,b)        scanf("%d %d",&a,&b)
#define siii(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define sl(a)           scanf("%lld",&a)
#define sll(a,b)        scanf("%lld %lld",&a,&b)
#define slll(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)

#define lli long long
#define m_p make_pair
#define p_b push_back

#define lim 10000000000
#define mod 100007
#define mx 100004
#define PI  3.141592654
using namespace std;

///** Direction Array **
//int dirx[]= {1,0,-1,0};
//int diry[]= {0,1,0,-1};

///*** Translator Functions**
//int ToInt(string s){int r = 0;stringstream sin(s);sin >> r;return r;}
//double ToDouble(string s) { double r = 0; stringstream sin(s); sin >> r; return r; }
//string ToString(int n)  {  string s;    stringstream convert;convert << n;s = convert.str();return s;}
///****My code goes from here***
vector<double> ans;
vector<int>v;
int a,b;
int ask(int x)
{
    int low=0,high=a-1;
    while(low<=high)
    {
        int mid=(low+high)/2;
        if(v[mid]>x){
            high=mid-1;
        }
        else{
            low=mid+1;
        }
    }
    return low-1;
}
int main()
{

    cin>>a>>b;

    for(int i=0; i<a; i++)
    {
        int x;
        cin>>x;
        v.p_b(x);
    }
    //sort(v.begin(),v.end());
    for(int i=0; i<a; i++)
    {
        int p=v[i]+b;
        int idx=ask(p);
        if(idx-i>=2&&idx<a)
        {
            double pp=v[i];
            double q=v[i+1];
            double r=v[idx];
            double tt=(r-q);
            tt=tt/(r-pp);
            ans.p_b(tt);
//            cout<<i<<endl;
//            printf("%.8f\n",tt);
        }

    }
    sort(ans.begin(),ans.end());
    if(ans.size()==0) cout<<"-1"<<endl;
    else printf("%.10f\n",ans[ans.size()-1]);

}


#include<bits/stdc++.h>

#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)

#define si(a)           scanf("%d",&a)
#define sii(a,b)        scanf("%d %d",&a,&b)
#define siii(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define sl(a)           scanf("%lld",&a)
#define sll(a,b)        scanf("%lld %lld",&a,&b)
#define slll(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)

#define lli long long
#define m_p make_pair
#define p_b push_back

#define lim 10000000000
#define mod 100007
#define mx 100004
#define PI  3.141592654
using namespace std;

///** Direction Array **
//int dirx[]= {1,0,-1,0};
//int diry[]= {0,1,0,-1};

///*** Translator Functions**
//int ToInt(string s){int r = 0;stringstream sin(s);sin >> r;return r;}
//double ToDouble(string s) { double r = 0; stringstream sin(s); sin >> r; return r; }
//string ToString(int n)  {  string s;    stringstream convert;convert << n;s = convert.str();return s;}
///****My code goes from here***
vector<double> ans;
vector<int>v;
int a,b;
int ask(int x)
{
    int low=0,high=a-1;
    while(low<=high)
    {
        int mid=(low+high)/2;
        if(v[mid]>x){
            high=mid-1;
        }
        else{
            low=mid+1;
        }
    }
    return low-1;
}
int main()
{

    cin>>a>>b;

    for(int i=0; i<a; i++)
    {
        int x;
        cin>>x;
        v.p_b(x);
    }
    //sort(v.begin(),v.end());
    for(int i=0; i<a; i++)
    {
        int p=v[i]+b;
        int idx=ask(p);
        if(idx-i>=2&&idx<a)
        {
            double pp=v[i];
            double q=v[i+1];
            double r=v[idx];
            double tt=(r-q);
            tt=tt/(r-pp);
            ans.p_b(tt);
//            cout<<i<<endl;
//            printf("%.8f\n",tt);
        }

    }
    sort(ans.begin(),ans.end());
    if(ans.size()==0) cout<<"-1"<<endl;
    else printf("%.8f\n",ans[ans.size()-1]);

}


#include<bits/stdc++.h>

#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)

#define si(a)           scanf("%d",&a)
#define sii(a,b)        scanf("%d %d",&a,&b)
#define siii(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define sl(a)           scanf("%lld",&a)
#define sll(a,b)        scanf("%lld %lld",&a,&b)
#define slll(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)

#define lli long long
#define m_p make_pair
#define p_b push_back

#define lim 10000000000
#define mod 100007
#define mx 100004
#define PI  3.141592654
using namespace std;

///** Direction Array **
//int dirx[]= {1,0,-1,0};
//int diry[]= {0,1,0,-1};

///*** Translator Functions**
//int ToInt(string s){int r = 0;stringstream sin(s);sin >> r;return r;}
//double ToDouble(string s) { double r = 0; stringstream sin(s); sin >> r; return r; }
//string ToString(int n)  {  string s;    stringstream convert;convert << n;s = convert.str();return s;}
///****My code goes from here***
vector<double> ans;
vector<int>v;
int a,b;
int main()
{

    cin>>a>>b;

    for(int i=0; i<a; i++)
    {
        int x;
        cin>>x;
        v.p_b(x);
    }
    //sort(v.begin(),v.end());
    for(int i=0; i<a; i++)
    {
        int p=v[i]+b;
        int idx=lower_bound(v.begin(),v.end(),p)-v.begin();
        if(idx>=a) {
            if(v[a-1]<=p) idx=a-1;
        }
        else{
            if(v[idx]>p) idx--;
        }
        if(idx-i>=2&&idx<a)
        {
            double pp=v[i];
            double q=v[i+1];
            double r=v[idx];
            double tt=(r-q);
            tt=tt/(r-pp);
            ans.p_b(tt);
//            cout<<i<<endl;
//            printf("%.8f\n",tt);
        }

    }
    sort(ans.begin(),ans.end());
    if(ans.size()==0) cout<<"-1"<<endl;
    else printf("%.9f\n",ans[ans.size()-1]);

}


#include<bits/stdc++.h>

#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)

#define si(a)           scanf("%d",&a)
#define sii(a,b)        scanf("%d %d",&a,&b)
#define siii(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define sl(a)           scanf("%lld",&a)
#define sll(a,b)        scanf("%lld %lld",&a,&b)
#define slll(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)

#define lli long long
#define m_p make_pair
#define p_b push_back

#define lim 10000000000
#define mod 100007
#define mx 100004
#define PI  3.141592654
using namespace std;

///** Direction Array **
//int dirx[]= {1,0,-1,0};
//int diry[]= {0,1,0,-1};

///*** Translator Functions**
//int ToInt(string s){int r = 0;stringstream sin(s);sin >> r;return r;}
//double ToDouble(string s) { double r = 0; stringstream sin(s); sin >> r; return r; }
//string ToString(int n)  {  string s;    stringstream convert;convert << n;s = convert.str();return s;}
///****My code goes from here***
vector<double> ans;
vector<int>v;
int a,b;
int main()
{

    cin>>a>>b;

    for(int i=0; i<a; i++)
    {
        int x;
        cin>>x;
        v.p_b(x);
    }
    //sort(v.begin(),v.end());
    for(int i=0; i<a; i++)
    {
        int p=v[i]+b;
        int idx=lower_bound(v.begin(),v.end(),p)-v.begin();
        if(idx>=a) {
            if(v[a-1]<=p) idx=a-1;
        }
        else{
            if(v[idx]>p) idx--;
        }
        if(idx-i>=2&&idx<a)
        {
            double pp=v[i];
            double q=v[i+1];
            double r=v[idx];
            double tt=(r-q);
            tt=tt/(r-pp);
            ans.p_b(tt);
//            cout<<i<<endl;
//            printf("%.8f\n",tt);
        }

    }
    sort(ans.begin(),ans.end());
    if(ans.size()==0) cout<<"-1"<<endl;
    else printf("%.8f\n",ans[ans.size()-1]);

}


#include <bits/stdc++.h>

using namespace std;

vector < pair < int, int > > v;
int n;
int64_t mm = 0;

int64_t ok(int64_t val, int64_t x){
	int64_t lo = 0, hi = mm, mid, ans = 0;
	while( lo <= hi ){
		mid = (lo + hi) >> 1LL;
		if( (mid * x) <= val ){
			ans = mid;
			lo = mid+1;
		}
		else{
			hi = mid-1;
		}
	}
	return ans;
}
int64_t check(){
	set < int > r;
	int64_t ans = mm;
	for(int i = 0; i < n; i++){
		r.insert(i);
	}
	for(int i = 0; i < n-1; i++){
		r.erase(v[i].second);
		int64_t m = v[i].first;
		int lo = *r.begin();
		int hi = *(r.end()--);
		ans = min(ans, ok(m, max(abs(hi-v[i].second),abs(lo-v[i].second))));
	}
	return ans;
}

int main(){
	ios::sync_with_stdio(false);

	cin >> n;

	for(int i = 0, vv; i < n; i++){
		cin >> vv;
		v.push_back({vv, i});
		mm = max(mm, int64_t(vv));
	}
	sort(v.begin(), v.end());

	cout << check() << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector < pair < int, int > > v;
int n;
uint64_t mm = 0;

uint64_t ok(uint64_t val, uint64_t x){
	uint64_t lo = 0, hi = 3000000000000000LL, mid, ans = 0;
	while( lo <= hi ){
		mid = (lo + hi) >> 1LL;
		if( (mid * x) <= val ){
			ans = mid;
			lo = mid+1;
		}
		else{
			hi = mid-1;
		}
	}
	return ans;
}
uint64_t check(){
	uint64_t ans = 3000000000000000LL;
	for(int i = 0; i < n-1; i++){
		uint64_t m = v[i].first;
		ans = min(ans, ok(m, max(abs(0-v[i].second),abs((n-1)-v[i].second))));
	}
	return ((ans == 3000000000000000LL) ? (0) : (ans));
}

int main(){
	ios::sync_with_stdio(false);

	cin >> n;

	for(int i = 0, vv; i < n; i++){
		cin >> vv;
		v.push_back({vv, i});
		mm = max(mm, uint64_t(vv));
	}
	sort(v.begin(), v.end());

	cout << check() << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector < pair < int, int > > v;
int n;

int check(int64_t val){
	int lo = 0, hi = n-1;
	while( lo < hi ){
		int64_t m = min(v[lo].first, v[hi].first);
		if( (val * int64_t(abs(v[lo].second-v[hi].second))) > m ) return false;
		lo++;
		hi--;
	}
	return true;
}

int main(){
	ios::sync_with_stdio(false);

	cin >> n;

	for(int i = 0, vv; i < n; i++){
		cin >> vv;
		v.push_back({vv, i});
	}
	sort(v.begin(), v.end());

	int lo = 0, hi = 1000000, mid, ans = 0;
	while( lo <= hi ){
		mid = (lo + hi) >> 1;

		if( check(mid) ){
			ans = mid;
			lo = mid+1;
		}
		else{
			hi = mid-1;
		}
	}
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector < pair < int, int > > v;
int n;
uint64_t mm = 0;

uint64_t ok(uint64_t val, uint64_t x){
	uint64_t lo = 0, hi = 3000000000000000LL, mid, ans = 0;
	while( lo <= hi ){
		mid = (lo + hi) >> 1LL;
		if( (mid * x) <= val ){
			ans = mid;
			lo = mid+1;
		}
		else{
			hi = mid-1;
		}
	}
	return ans;
}
uint64_t check(){
	set < int > r;
	uint64_t ans = 3000000000000000LL;
	for(int i = 0; i < n; i++){
		r.insert(i);
	}
	for(int i = 0; i < n-1; i++){
		r.erase(v[i].second);
		uint64_t m = v[i].first;
		int lo = *r.begin();
		int hi = *(r.end()--);
		ans = min(ans, ok(m, max(abs(hi-v[i].second),abs(lo-v[i].second))));
	}
	return ((ans == 3000000000000000LL) ? (0) : (ans));
}

int main(){
	ios::sync_with_stdio(false);

	cin >> n;

	for(int i = 0, vv; i < n; i++){
		cin >> vv;
		v.push_back({vv, i});
		mm = max(mm, uint64_t(vv));
	}
	sort(v.begin(), v.end());

	cout << check() << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector < pair < int, int > > v;
int n;

int64_t ok(int64_t val, int64_t x){
	int64_t lo = 0, hi = 1000000000, mid, ans = 0;
	while( lo <= hi ){
		mid = (lo + hi) >> 1LL;
		if( (mid * x) <= val ){
			ans = mid;
			lo = mid+1;
		}
		else{
			hi = mid-1;
		}
	}
	return ans;
}
int64_t check(){
	set < int > r;
	int64_t ans = 1e9;
	for(int i = 0; i < n; i++){
		r.insert(i);
	}
	for(int i = 0; i < n-1; i++){
		r.erase(v[i].second);
		int64_t m = v[i].first;
		int lo = *r.begin();
		int hi = *(r.end()--);
		ans = min(ans, ok(m, max(abs(hi-v[i].second),abs(lo-v[i].second))));
	}
	return ans;
}

int main(){
	ios::sync_with_stdio(false);

	cin >> n;

	for(int i = 0, vv; i < n; i++){
		cin >> vv;
		v.push_back({vv, i});
	}
	sort(v.begin(), v.end());

	cout << check() << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector < pair < int, int > > v;
int n;
int64_t mm = 0;

int64_t ok(int64_t val, int64_t x){
	int64_t lo = 0, hi = mm, mid, ans = 0;
	while( lo <= hi ){
		mid = (lo + hi) >> 1LL;
		if( (mid * x) <= val ){
			ans = mid;
			lo = mid+1;
		}
		else{
			hi = mid-1;
		}
	}
	return ans;
}
int64_t check(){
	set < int > r;
	int64_t ans = 300000000000000LL;
	for(int i = 0; i < n; i++){
		r.insert(i);
	}
	for(int i = 0; i < n-1; i++){
		r.erase(v[i].second);
		int64_t m = v[i].first;
		int lo = *r.begin();
		int hi = *(r.end()--);
		ans = min(ans, ok(m, max(abs(hi-v[i].second),abs(lo-v[i].second))));
	}
	return ans;
}

int main(){
	ios::sync_with_stdio(false);

	cin >> n;

	for(int i = 0, vv; i < n; i++){
		cin >> vv;
		v.push_back({vv, i});
		mm = max(mm, int64_t(vv));
	}
	sort(v.begin(), v.end());

	cout << check() << '\n';
	return 0;
}


#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int nn, idx, jdx;
    cin >> nn;
    vector<int> aa(nn);
    for (int &elem : aa)
        cin >> elem;
    int ans = INT_MAX;
    for (idx = 0; idx < nn - 1; ++idx) {
        for (jdx = nn - 1; jdx >= idx + 1; --jdx) {
            ans = min(ans, (min(aa[idx], aa[jdx]) / (jdx - idx)));
            if (ans == 0) goto end;
        }
    }
    end: cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int nn, idx, jdx;
    cin >> nn;
    vector<int> aa(nn);
    for (idx = 0; idx < nn; ++idx) {
        cin >> aa[idx];
    }
    int kk = 1;
    while (true) {
        for (idx = 0; idx < nn; ++idx) {
            for (jdx = idx; jdx < nn; ++jdx) {
                if (kk * abs(idx - jdx) > min(aa[idx], aa[jdx]))
                    goto end;
            }
        }
        ++kk;
    }
    end:
    cout << kk - 1 << '\n';
    return 0;
}


#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int nn, idx, jdx;
    cin >> nn;
    vector<int> aa(nn);
    for (idx = 0; idx < nn; ++idx)
        cin >> aa[idx];
    int ans = INT_MAX;
    for (idx = 0; idx < nn; ++idx) {
        for (jdx = idx; jdx < nn; ++jdx) {
            ans = min(ans, (min(aa[idx], aa[jdx]) / (jdx - idx)));
        }
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int nn, idx, jdx;
    cin >> nn;
    vector<int> aa(nn);
    for (idx = 0; idx < nn; ++idx)
        cin >> aa[idx];
    int ans = INT_MAX;
    for (idx = 0; idx < nn; ++idx) {
        for (jdx = idx; jdx < nn; ++jdx) {
            ans = min(ans, min(aa[idx], aa[jdx]) / (jdx - idx));
        }
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int nn, idx, cur, ans = INT_MAX;
    cin >> nn;
    for (idx = 0; idx < nn; ++idx) {
        cin >> cur;
        ans = min(ans, cur / max(idx, nn - idx - 1));
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int nn, idx, jdx;
    cin >> nn;
    vector<int> aa(nn);
    for (int &elem : aa)
        cin >> elem;
    int ans = INT_MAX;
    for (idx = 0; idx < nn - 1; ++idx) {
        for (jdx = idx + 1; jdx < nn; ++jdx) {
            ans = min(ans, (min(aa[idx], aa[jdx]) / (jdx - idx)));
        }
    }
    cout << ans << '\n';
    return 0;
}


            #include <bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            #define pb push_back
            #define f first
            #define s second
            const int MAX=1e5+55;
            ll x[3*MAX];
            int main()
            {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        bool t=1;

  int n;
  cin>>n;
  ll MIN=10000000000;
  for(int i=1;i<=n;i++){
    cin>>x[i];
    MIN=min(MIN,x[i]);
            }
    MIN/=2;
    if(MIN*(n-1)<=min(x[1],x[n]))
       cout<<MIN;
    else
    {
        ll m=min(x[1],x[n]);
        ll mm=(MIN*(n-1))-m;
        MIN-=mm;
        cout<<MIN;
    }

                return 0;
            }


                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define pb push_back
                #define f first
                #define s second
                const int MAX=1e5+55;
                ll x[3*MAX];
                int main()
                {
            ios_base::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            bool t=1;

      int n;
      cin>>n;
      ll MIN=10000000000;
       ll ans=10000000000;
      for(int i=1;i<=n;i++){
        cin>>x[i];
      MIN=min(MIN,x[i]);
                }

       for(int i=1;i<=n-1;i++)
       {

        if(MIN*i<=min(x[i],x[i+1]))
            continue;
        else
        {
            while(MIN*i>x[i+1])
            {
                MIN/=2;
            }

        }
       }
       cout<<MIN;

                    return 0;
                }


                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define pb push_back
                #define f first
                #define s second
                const int MAX=1e5+55;
                ll x[3*MAX];
                int main()
                {
            ios_base::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            bool t=1;

      int n;
      cin>>n;
      ll MIN=10000000000;
      for(int i=1;i<=n;i++){
        cin>>x[i];
        MIN=min(MIN,x[i]);
                }
        if(MIN*(n-1)<=min(x[1],x[n])){
           cout<<MIN; return 0;}
         MIN/=2;
         if(MIN*(n-1)<=min(x[1],x[n]))
         {
             cout<<MIN; return 0;
         }
        while(MIN!=0)
        {

            ll m=min(x[1],x[n]);
            ll mm=(MIN*(n-1))-m;
            if((MIN*(n-1))<=m){
            cout<<MIN; return 0;}
            MIN/=2;
        }

                    return 0;
                }


                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define pb push_back
                #define f first
                #define s second
                const int MAX=1e5+55;
                ll x[3*MAX];
                int main()
                {
            ios_base::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            bool t=1;

      int n;
      cin>>n;
      ll MIN=100000000000;
       ll ans=100000000000;
      for(int i=1;i<=n;i++){
        cin>>x[i];
      MIN=min(MIN,x[i]);
                }

       for(int i=1;i<=n;i++)
       {

        if(MIN*(i-1)<=x[i])
            continue;
        else
        {
            while(MIN*(i-1)>max(x[i],x[i+1]))
            {
               MIN--;
            }

        }
       }
       cout<<MIN;

                    return 0;
                }


            #include <bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            #define pb push_back
            #define f first
            #define s second
            const int MAX=1e5+55;
            ll x[3*MAX];
            int main()
            {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        bool t=1;

  int n;
  cin>>n;
  ll MIN=10000000000;
  for(int i=1;i<=n;i++){
    cin>>x[i];
    MIN=min(MIN,x[i]);
            }
    if(MIN*(n-1)<=min(x[1],x[n]))
       cout<<MIN;
    else if(t)
    {
        MIN/=2;
         if(MIN*(n-1)<=min(x[1],x[n]))
       cout<<MIN;
    }
    else
    {
        ll m=min(x[1],x[n]);
        ll mm=(MIN*(n-1))-m;
        MIN-=mm;
        cout<<MIN;
    }

                return 0;
            }


                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define pb push_back
                #define f first
                #define s second
                const int MAX=1e5+55;
                ll x[3*MAX];
                int main()
                {
            ios_base::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            bool t=1;

      int n;
      cin>>n;
      ll MIN=10000000000;
      for(int i=1;i<=n;i++){
        cin>>x[i];
        MIN=min(MIN,x[i]);
                }
        if(MIN*(n-1)<=min(x[1],x[n])){
           cout<<MIN; return 0;}
         MIN/=2;
         if(MIN*(n-1)<=min(x[1],x[n]))
         {
             cout<<MIN; return 0;
         }
        else if(MIN*(n-1)>min(x[1],x[n]))
        {

            ll m=min(x[1],x[n]);
            ll mm=(MIN*(n-1))-m;
            MIN-=mm;
            cout<<MIN;
        }

                    return 0;
                }


            #include <bits/stdc++.h>
            using namespace std;
            typedef long long ll;
            #define pb push_back
            #define f first
            #define s second
            const int MAX=1e5+55;
            ll x[3*MAX];
            int main()
            {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        bool t=1;

  int n;
  cin>>n;
  ll MIN=10000000000;
  for(int i=1;i<=n;i++){
    cin>>x[i];
    MIN=min(MIN,x[i]);
            }
    if(MIN*(n-1)<=min(x[1],x[n])){
       cout<<MIN; return 0;}
     MIN/=2;
     if(MIN*(n-1)<=min(x[1],x[n]))
     {
         cout<<MIN; return 0;
     }
    else
    {

        ll m=min(x[1],x[n]);
        ll mm=(MIN*(n-1))-m;
        MIN-=mm;
        cout<<MIN;
    }

                return 0;
            }


                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define pb push_back
                #define f first
                #define s second
                const int MAX=1e5+55;
                ll x[3*MAX];
                int main()
                {
            ios_base::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            bool t=1;

      int n;
      cin>>n;
      ll MIN=10000000000;
       ll ans=10000000000;
      for(int i=1;i<=n;i++){
        cin>>x[i];
      MIN=min(MIN,x[i]);
                }

       for(int i=1;i<=n-1;i++)
       {

        if(MIN*i<=min(x[i],x[i+1]))
            continue;
        else
        {
            while(MIN*i>max(x[i],x[i+1]))
            {
                MIN/=2;
            }

        }
       }
       cout<<MIN;

                    return 0;
                }


                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define pb push_back
                #define f first
                #define s second
                const int MAX=1e5+55;
                ll x[3*MAX];
                int main()
                {
            ios_base::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            bool t=1;

      int n;
      cin>>n;
      ll MIN=10000000000;
       ll ans=10000000000;
      for(int i=1;i<=n;i++){
        cin>>x[i];
      MIN=min(MIN,x[i]);
                }

       for(int i=1;i<=n;i++)
       {

        if(MIN*(i-1)<=x[i])
            continue;
        else
        {
            while(MIN*(i-1)>x[i])
            {
               MIN--;
            }

        }
       }
       cout<<MIN;

                    return 0;
                }