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