#include <stdio.h>
#include <memory.h>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

typedef long double ld;

//FILE *in = freopen("input.txt", "r", stdin);

int n, m;
int data[100];
int maxl, maxd;

void input() {
	maxl = -1;
	maxd = -1;
	memset(data, 0, sizeof(data));
	rep(i, n) {
		int x;
		scanf("%d", &x);
		data[x / m]++;
		if (maxl < x/m) maxl = x/m;
		if (maxd < data[x/m]) maxd = data[x/m];
	}
	maxl++;
}

void process() {
	ld sum = 0.01;

	rep(i, maxl) {
		sum += ((ld)(maxl-i-1)/(maxl-1)) * ( (ld)data[i]/(ld)maxd );
	}

	printf("%Lf\n", sum);
}

int main() {
	while(true) {
		scanf("%d%d", &n, &m);
		if (!n) break;
		input();
		process();
	}
	return 0;
}