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