#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;

int main(){
	while(1){
		int n,w;
		cin >> n >> w;
		if(n==0) break;
		
		vector<int> graph(11,0);
		int vmax=0;
		for(int i=0; i<n; i++){
			int v;
			cin >> v;
			vmax = max(v, vmax);
			graph[v/w]++;
		}
		
		int numbar=vmax/w+1;
		int hmax=0;
		double ans=0.0;
		for(int i=0; i<numbar; i++){
			ans += (double)graph[i]*(numbar-1-i)/(numbar-1);
			hmax = max(graph[i], hmax);
		}
		ans = ans/hmax + 0.01;
		cout << fixed;
		cout << setprecision(6);
		cout << ans << endl;	
	}
	return 0;
}