#include #include #include #include #include #include using namespace std; int main() { int a, b, x, y; cin >> a >> b >> x >> y; double k = min(1.0 * x / a, 1.0 * y / b); double ans = k * (a + b); printf("%.9f\n", ans); return 0; }