#include #include using namespace std; int main() { double a, b, x, y, ans; cin >> a >> b >> x >> y; if (x * b / a <= y) ans = x + x * b / a; else ans = y + y * a / b; cout << fixed << setprecision(8) << ans << endl; }