#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); double a, b, x, y; cin >> a >> b >> x >> y; double s, t; s = x * b / a; t = y * a / b; double ans = y >= s ? s + x : t + y; cout << setprecision(20) << ans << endl; return 0; }