#include #include #include #include using namespace std; template inline void print_STL(STL c, string ab = ""){ cout << ab << '\n'; for(auto t : c) cout << t << ' '; cout << '\n';} template inline void import_VEC(VEC& c, int n){ typename VEC::value_type tmp; for(int i = 0; i < n; ++i){ cin >> tmp; c.push_back(tmp);} } #define SPRE(x) setprecision(x) // 精度を指定 int main() { cin.tie(0); ios::sync_with_stdio(false); int a, b, x, y; cin >> a >> b >> x >> y; double xb = x * b; double ya = y * a; cout << SPRE(10) << scientific << (xb < ya ? x + xb/a : y + ya/b) << '\n'; }