loop do
    n, w = gets.split.map(&:to_i)
    break if n == 0 && w == 0
    vs = n.times.map{gets.to_i}
    h = Hash.new(0)
    vs.each do |v|
        h[v/w] += 1
    end
    ret = 0
    max = h.map{|k,v| v}.max
    maxk = h.map{|k,v| k}.max
    h.sort.each do |k,v|
        ret += (v.to_f * (maxk - k).to_f / maxk.to_f) / max.to_f
    end
    puts ret + 0.01
end