#include #include int main(){ int a, b, x, y; std::cin >> a >> b>> x >> y; std::cout << std::setprecision(10); if(x * (a + b) / a <= x + y){ std::cout << x * (a + b) / static_cast(a) << std::endl; }else{ std::cout << y * (a + b) / static_cast(b) << std::endl; } return 0; }