#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, k;
int x[N];
void solve() {
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> x[i];
}
sort(x + 1, x + 1 + n);
int ans = 0;
for (int i = 1; i <= n; i++) {
int j = upper_bound(x + 1, x + n + 1, x[i] + k) - x;
ans = max(ans, j - i);
}
cout << double(ans) / n << "\n";
}
int main() {
cout << setprecision(6) << fixed;
cin.tie(0)->sync_with_stdio(0);
int T = 1;
// cin >> T;
while (T--) solve();
}
// 64 位输出请用 printf("%lld")



京公网安备 11010502036488号