//https://ncode.syosetu.com/n4830bu/236/ #include using namespace std; int main() { double A, B, X, Y; cin >> A >> B >> X >> Y; cout << fixed << setprecision(10) << min(X / A, Y / B) * (A + B) << endl; }