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