#include #include using namespace std; int main() { double a, b, x, y; cin >> a >> b >> x >> y; double res; if (x * b >= y * a) { res = y + (a / b) * y; } else { res = x + (b / a) * x; } printf("%.5f", res); }