#include #include using namespace std; int main(){ double a,b,x,y; cin >> a >> b >> x >> y; printf("%.10lf\n",(a+b)*min(x/a,y/b)); return 0; }