import std.stdio, std.conv, std.string, std.algorithm;

void main(){
	while(true){
		int n, w;
		readf("%d %d", &n, &w);readln();
		if(n == 0 || w == 0) break;
		int[int] histgram;
		foreach(i; 0..n){
				int v = readln.chomp.to!int;
				histgram[v/w]++;
		}
		int keyMax = reduce!max(histgram.keys);
		int valMax = reduce!max(histgram.values);
		real result = 0.01;
		foreach(i; 0..keyMax){
			int* v = i in histgram;
			if(v == null) continue;
			result += cast(real)(keyMax-i)/keyMax**v/valMax;
		}
		writeln(result);
	}
}