#include #include using ldouble = long double; void solve() { ldouble a, b, x, y; std::cin >> a >> b >> x >> y; std::cout << std::fixed << std::setprecision(10) << std::min(x / a, y / b) * (a + b) << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }