import Data.Ratio ((%),numerator,denominator)
import Data.Char (intToDigit)

type N = Integer
type K = Integer
type M = Int
type R = Int

main = do
    [n,k,m,r] <- getLine >>= return . map read . words :: IO [Int]

    if all (==0) [n,k,m,r] then return () else do
        let
            n' = fromIntegral n
            k' = fromIntegral k
        putStrLn $ solve ((fromIntegral n),(fromIntegral k),m,r)
        main    

solve :: (N,K,M,R) -> String
solve (n,k,m,r) = toString r $ p m n

p :: M -> N -> Rational
p 0 n = 1 % n
p 1 n = p 0 n + (harmonicTo (n-1)) / (fromIntegral n)

harmonicTo :: Integer -> Rational
harmonicTo n = harmonicTo' 0 1 1
    where
    harmonicTo' a b n'
        | n' > n = a % b
        | otherwise = g `seq` harmonicTo' ((a*n'+b)`div`g) ((b*n')`div`g) (n'+1)
        where
        g = gcd b n'
{--
harmonicTo n = sum $ map (1 %) [1..n]
--}

toString :: R -> Rational -> String
toString r p = insertDot $ toString' (numerator p) (denominator p) 0
    where
    insertDot (c:cs) = c:'.':cs
    toString' a b r'
        | r' <= r   = d : toString' a' b (r'+1)
        | otherwise = []
        where
        d = intToDigit $ fromIntegral (a `div` b)
        a' = 10 * (a `mod` b)