#include int main() { double a, b, x, y; scanf("%lf %lf %lf %lf", &a, &b, &x, &y); printf("%.8lf\n", x/a*b<=y ? x/a*b+x: y/b*a+y); return 0; }