#include <stdio.h>

int main(void) {
	int n,w;
	int list_of_num[11];
	int now;
	int i;
	int highest,right_most;
	double result;
	while(1) {
		scanf("%d%d",&n,&w);
		if(n==0 && w==0)break;
		for(i=0;i<=10;i++)list_of_num[i]=0;
		for(i=0;i<n;i++) {
			scanf("%d",&now);
			list_of_num[now/w]++;
		}
		highest=0;right_most=0;
		for(i=0;i<=10;i++) {
			if(list_of_num[i]>highest)highest=list_of_num[i];
			if(list_of_num[i]>0) {
				right_most=i;
			}
		}
		result=0.01;
		for(i=0;i<right_most;i++) {
			result+=((double)list_of_num[i]/highest)*
				((double)(right_most-i)/right_most);
		}
		printf("%.15f\n",result);
	}
	return 0;
}