import strutils, sequtils var a, b, x, y: float (a, b, x, y) = stdin.readLine.split.map parseFloat echo min(x + x / a * b, y / b * a + y)