ans' :: Int -> Float -> Float -> Float -> Float -> Int
ans' n r0 w0 c r =
     let n' = fromIntegral n :: Float
     in
        if ( (n' * r + r0) / w0) >= c
        then n
        else ans' (n+1) r0 w0 c r

ans :: [[Float]] -> [Int]
ans ([0,0,0,0]:xs) = []
ans ([r0,w0,c,r]:xs) =
    (ans' 0 r0 w0 c r):(ans xs)

main = do
     c <- getContents
     let i = map (map read) $ map words $　lines c :: [[Float]]
         o = ans i
     mapM_ print o
     
