#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int h[20];
int main() {
	int n, w;
	while (scanf("%d%d", &n, &w), n) {
		memset(h, 0, sizeof(h));
		rep(i, n) {
			int v; scanf("%d", &v);
			h[v / w]++;
		}
		int j = 0;
		rep(i, 20) {
			if (h[i])j = i + 1;
		}
		double dark = 1, d = 1. / (j - 1), sum = 0;
		double k = (double)*max_element(h, h + 20);
		for (int i = 0; i < j; i++) {
			sum += dark*h[i] / k;
			dark -= d;
		}
		printf("%.8lf\n", sum + 0.01);
	}
}