#include <cstdio>
#include <algorithm>
using namespace std;

int main(){
	int n, w, v;
	while( scanf("%d %d", &n, &w), n || w ){
		int m[110] = {0}, maxi = 0, cnt = 0;
		for(int i = 0; i < n; i++){
			scanf("%d", &v);
			m[v/w]++;
			maxi = max(maxi, m[v/w]);
			cnt = max(cnt, v);
		}
		
		cnt = (cnt / w) + 1;
		
		double a = 1, ans = 0.01;
		for(int i = 0; i < cnt; i++){
			ans += a * ((double)m[i] / maxi);
			a -= 1.0 / (cnt - 1);
		}
		printf("%.7f\n", ans);
	}
}