#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MOD 1000000007 #define INF 11234567890 #define in std::cin #define out std::cout #define rep(i,N) for(LL i=0;i P; double A, B, X, Y; int main() { in >> A >> B >> X >> Y; out << std::fixed << std::setprecision(10); if (A == B) { out << std::min(X, Y) * 2 << std::endl; } else if (A > B) { out << X / A*(A + B) << std::endl; } else { out << Y / B*(A + B) << std::endl; } return 0; }