#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); double A,B,X,Y; cin >> A >> B >> X >> Y; double ans = 0; if(Y >= B * X / A) ans = X + B * X / A; if(X >= A * Y / B) ans = Y + A * Y / B; cout.precision(17); cout << ans << endl; }