a, b, x, y = map(float, raw_input().split()) if x / a < y / b: print x + b * (x / a) else: print a * (y / b) + y