A, B, X, Y = map(int, input().split()) z = min(X*(A+B) / A, Y*(A+B) / B) print(z)