#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; double x,y,a,b; double ans; bool func(double k) { double n = a/(a+b); double m = b/(a+b); double aa = n * k; double bb = m * k; return x > aa && y > bb; } int main() { cin >> a >> b >> x >> y; double mid; double low = -100; double hi = 3000; while(hi - low > 0.00000001) { mid = (hi + low)/2; if(func(mid)) { low = mid; } else { hi = mid; } } cout << low << endl; return 0; }