### main

loop do
  n, k, m, r = gets.strip.split(' ').map{|s| s.to_i}
  break if (n | k | m | r) == 0
  #p [n, k, m, r]

  sum = s0 = Rational(1, n)

  if m > 0
    for i in (1...n)
      sum += Rational(1, i) * s0
    end
  end

  printf("%.*f\n", r, sum.to_f)
end