#include<iostream>
#include <iomanip>
#include<string.h>

using namespace std;

int main(){
	while(1){
		int n,w;
		cin >> n >> w;
		if(n == 0) break;
		
		int v[101];
		int max_num = 0;
		int interval[12];
		memset(interval,0,sizeof(interval));
		for(int i = 0;i < n;i++){
			cin >> v[i];
			if(v[i] > max_num) max_num = v[i];
			interval[v[i]/w]++;
		}
		
		int inter_num = max_num / w + 1;
		int max_index = 0;
		for(int i = 1;i < inter_num;i++){
			if(interval[max_index] < interval[i]) max_index = i;
		}
		
		float ans = 0.0;
		for(int i = 0;i < inter_num;i++){
			ans += ((interval[i] * 1.0) / interval[max_index]) * ((inter_num - 1 - i) * 1.0/(inter_num - 1));
		}
		ans += 0.01;
		cout << fixed << setprecision(6) << ans << endl;
	}
	return 0;
}
