while true
  n, k, m, r = gets.split.map(&:to_i)
  break if n == 0
  x, y = 1, n
  x, y = (1...n).reduce([1, 1]){ |b, i| [b[0] * i + b[1], b[1] * i]}.zip([x, y]).map{ |a, b| a * b } if m == 1
  g = x.gcd(y)
  x /= g; y /= g
  print  (x / y).to_s + "."
  x = (x - y * (x / y)) * 10
  r.times.reduce(x){ |t, _| print t / y; (t - y * (t / y)) * 10 }
  puts
end