until (n, k, m, r = gets.split.map(&:to_i)).all?(&:zero?)
  ans = 10**(r+5) / n
  ans += (1...n).inject(0){|sum, i| sum + 10**(r+5)/i} / n unless m.zero?
  s = ans.to_s
  s = "0" + s until (r+5) < s.size
  print s[0]
  print "."
  puts s[1..r]
end