#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; double res1, res2; int main() { in >> A >> B >> X >> Y; res1 = X / A*(A + B); res2 = Y / B*(A + B); res1 = (res1 > X + Y ? -1 : res1); res2 = (res2 > X + Y ? -1 : res2); out << std::fixed << std::setprecision(10); out << std::max(res1, res2) << std::endl; return 0; }