a, b, x, y = map(int, input().split()) if x * b == y * a: print(x + y) elif x * b > y * a: print(y + y * a / b) else: print(x + x * b / a)