#include <stdio.h>
#include <string.h>
#define max(a,b) a > b ? a : b

int main(void){
	int n, w, v[100], i, j, count[11], num, max;
	double sum;
	while(1){
		scanf("%d%d",&n,&w);
		if(n == 0 && w == 0)
			break;
		max = 0;
		for(i = 0;i < n;i++){
			scanf("%d",&v[i]);
			max = max(max,v[i]);
		}
		num = max / w + 1;
		memset(count,0,sizeof(count));
		max = 0;
		for(i = 0;i < n;i++){
			for(j = 0;j < num;j++){
				if(j * w <= v[i] && v[i] < (j + 1) * w)
					count[j]++;
			}
		}


		for(i = 0;i < num;i++)
			max = max(max,count[i]);
		sum = 0;
		if(num != 1){
			for(i = 0;i < num;i++){
				sum += ((double)(num - 1 - i) / (num - 1)) * ((double)count[i] / max);
			}
			printf("%.16f\n",sum + 0.01);
		}
		else
			printf("1.01\n");
	}
	return 0;
}