#include <set>
#include <map>
#include <cstdio>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

inline int getInt(){ int s; scanf("%d", &s); return s; }

using namespace std;

int main(){
  while(true){
    int n = getInt();
    int w = getInt();

    if(n + w == 0) break;

    map<int, int> v;
    v[0] = 0;

    REP(i,n)
      v[getInt() / w]++;

    int mx  = v.rbegin()->first;
    int mxv = 0; FOR(it, v) mxv = max(mxv, it->second);
    double ans = 0.01;
    if(mx == 0){
      ans += 1.0;
    }else{
      REP(i,mx+1){
        ans += (((double)v[i]) / mxv) * (((double)(mx - i)) / mx);
      }
    }
    printf("%.7f\n", ans);
  }
  return 0;
}