/*
  AOJ 1285
  Title:Grey Area
  @kankichi573
*/
#include <stdio.h>
#include <string.h>
#define max(x,y) (((x)>(y))?(x):(y))

int n,w,step;
int histg[11];

main()
{
  int i,s,high,val;
  double ret;
  while(scanf("%d %d",&n, &w)  && (n||w))
    {
      memset(histg,0,sizeof(histg));
      for(i=step=high=0;i<n;i++)
	{
	  scanf("%d",&val);
	  s=(val/w);
	  step=max(step,s);
	  histg[s]++;
	  high=max(high,histg[s]);
	}
      for(i=0,ret=0.0;i<step;i++)
	ret += ((double)histg[i]*(step-i))/((double)high*step);
      printf("%lf\n",ret+0.01);
    }
  return(0);
}