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

int main()
{
	cout << fixed << setprecision(7);
	int n, w;
	while (cin >> n >> w, n || w) {
		double res = 0.01;
		vector<int> inter(20, 0);
		for (int i = 0, v; i < n; i++) {
			cin >> v;
			inter[v / w]++;
		}
		while (inter.back() == 0) {
			inter.pop_back();
		}
		int maxi = -1;
		for (int i = 0; i < inter.size(); i++) {
			maxi = max(maxi, inter[i]);
		}
		for (int i = 0; i < inter.size(); i++) {
			res += (double)inter[i] / maxi * (inter.size() >= 2 ? (double)(inter.size() - i - 1) / (inter.size() - 1) : 1.0);
		}
		cout << res << endl;
	}
	return 0;
}