#include #include using namespace std; int main(){ int A,B; int X,Y; cin>>A>>B>>X>>Y; printf("%.12f\n",(((double)X/A<(double)Y/B)?X+B*(double)X/A:Y+A*(double)Y/B)); }