#include #include #include using namespace std; int main(){ double a,b,x,y; cin >> a >> b >> x >> y; cout << fixed << setprecision(10) << (a + b) * min(x / a,y / b) << endl; }