module Main where import Control.Monad import Text.Printf (printf) main :: IO () main = do [a, b, x, y] <- fmap read . words <$> getLine :: IO [Double] let d = min (x / a) (y / b) printf "%.7f\n" (d * (a + b))