var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
while(true){
   var nw=arr.shift().split(" ").map(Number);
   if(nw.join(" ")=="0 0")break;
   var n=nw[0];
   var w=nw[1];
   var V=[];
   for(var i=0;i<n;i++)V.push(arr.shift()-0);
   V.sort(function(a,b){return a-b;});
   var p=[];
   var len=(V[V.length-1]-(V[V.length-1]%w))/w;
   for(var i=0;i<len+1;i++)p.push(0);
   V.forEach(function(v){
      p[(v-(v%w))/w]++;
   });
   var d=Math.max.apply(null,p);
   var ans=0;
   p.forEach(function(v,i){
      ans+=(len-i)/len*v/d;
   });
   console.log((ans+0.01).toFixed(6));
}