#include #include using namespace std; int main(void) { //いつも自分が計算する方法 //コーヒーか紅茶はすべて使う、もう一方は比を利用して求められるね double a, b, x, y, ans; cin >> a >> b >> x >> y; if (a*y == b*x) { ans = x + y; }else if(a*y>b*x){ ans = x*(1 + b / a); }else { ans = y*(1 + a / b); } cout << fixed << setprecision(10) << ans << endl; return 0; }