#include using namespace std; int main(){ double a, b, x, y; cin >> a >> b >> x >> y; double ans; if(a * y <= b * x){ ans = y + (a * y) / b; }else{ ans = x + (b * x) / a; } printf("%.10f\n", ans); }