open System type Sol() = member this.Solve() = let [| A;B;X;Y |] = stdin.ReadLine().Split() |> Array.map double let needY = X / A * B; let needX = Y / B * A; let ans = if needY <= Y then (X + needY) else (Y + needX) printfn "%f" ans let mySol = new Sol() mySol.Solve()