#include #include #include #include using namespace std; int main(void) { std::ios::sync_with_stdio(false); std::cin.tie(0); double A, B, X, Y; double result; cin >> A >> B >> X >> Y; double s = X * B / A; double t = Y * A / B; if (s < Y) { result = X + s; } else { result = Y + t; } cout << result << endl; }