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