#include<stdio.h>
int main(){
  int n,m,a,b[100010],i,c,d;
  double s;
  while(scanf("%d %d",&n,&m),n){
    c=d=0;
    for(i=0;i<110;i++)b[i]=0;
    for(i=s=0;i<n;i++){
      scanf("%d",&a);
      b[a/m]++;
      if(c<a/m)c=a/m;
      if(d<b[a/m])d=b[a/m];
    }
    for(i=0;i<=c;i++)s+=1.0*b[i]*(c-i)/(c);
    printf("%.10lf\n",s/d+0.01);
  }
  return 0;
}

