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

using i64 = int64_t;

int main(){
    int n, w;
    while(cin >> n >> w, n != 0){
        vector<int> v(105);
        int rightmost = 0, maxi = 0;
        for(int i=0;i<n;++i){
            int tmp;
            cin >> tmp;
            v[tmp/w]++;
            rightmost = max(rightmost, tmp/w);
            maxi = max(maxi,v[tmp/w]);
        }
        double ans = 0.01;
        for(int i=0;i<rightmost;++i){
            ans += v[i] * (rightmost-i)/(double)(maxi*rightmost);
        }
        printf("%.10f\n", ans);
    }

    return 0;
}

