while true do
  n, w = gets.split.map(&:to_i)
  break if n | w == 0
  histogram = Array.new
  n.times do
    v = gets.to_i
    histogram[v / w] = 0.0 if !histogram[v / w]
    histogram[v / w] += 1.0
  end
  histogram = histogram.collect{|e| e ? e : 0.0}
  largest = histogram.max
  size = histogram.size - 1
  answer = 0.01
  size.times do |i|
    answer += histogram[i] / largest * (size - i).to_f / size.to_f
  end
  p answer
end