#include<bits/stdc++.h>
using namespace std;

int main(){
  int n, w, sum[11];
  while(cin >> n >> w, n){
    fill_n( sum, 11, 0);

    int big = 0;
    for(int i = 0; i < n; i++){
      int v;
      cin >> v;
      ++sum[v / w];
      big = max( big, v / w);
    }
    int high = *max_element( sum, sum + big + 1);
    double ret = 0;
    for(int i = big; i >= 0; i--){
      ret += (double)((big - i) * sum[i]) / (big * high);  
    }
    cout << ret + 0.01 << endl;
  }
}