while true
    line = gets.chomp
    break if line == "0 0"
    n, w = line.split.map(&:to_i)
    arr = []
    n.times{arr << gets.to_i}
    arr2 = Array.new(arr.max / w + 1, 0)
    arr.each{|x| arr2[x / w] += 1}
    ink, max = 0.01, arr2.max
    arr2.each_with_index{|x, i| ink += Rational(x, max) * Rational(arr2.length - 1 - i , arr2.length - 1)}
    puts ink
end
