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