#include<iostream>
#include<cstring>
#include<algorithm>

using namespace std;
int main()
{
  int n,w;
  for(;cin>>n>>w,n;)
    {
      double ans=0.01;
      int v[n];
      int elia[w];
      int mmax=0;
      int last=0;
      memset(elia,0,sizeof(elia));
      for(int i=0;i<n;i++)
	{
	  cin>>v[i];
	  elia[v[i]/w]++;
	  mmax=max(mmax,elia[v[i]/w]);
	  last=max(last,v[i]/w);
	  //  cerr<<mmax<<"# #"<<last<<endl;
	}
      int cnt=last;
      for(int i=0;cnt>0;i++)
	{
	  //	  cerr<<cnt<<" "<<((double)last-1)<<" "<<elia[i]<<" "<<(double)mmax<<endl;
	  ans+=(cnt/((double)last))*(elia[i]/(double)mmax);
	  cnt--;
	}

      cout<<ans<<endl;

    }
}