require 'bigdecimal'

### 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 = BigDecimal(1, r + 10) / n

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

  sstr = sum.truncate(r).to_s("F")
  zlen = r - (sstr.length - 2)
  puts (sstr + "0" * zlen)
end