#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define lint long long int /* vectoral(26); al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; vectorAL(26); AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; */ int main() { int A, B, X, Y; cin >> A >> B >> X >> Y; double a, b, x, y; a = A; b = B; x = X; y = Y; if (a / b > x / y) { int ans = 0; ans = A * X + B * X; cout << ans / A; cout << '.'; ans = ans % A * 10; for (int ia = 0; ia < 10; ia++) { cout << ans / A; ans = ans % A * 10; } } else if (a / b < x / y) { int ans = 0; ans = B * Y + A * Y; cout << ans / B; cout << '.'; ans = ans % B * 10; for (int ia = 0; ia < 10; ia++) { cout << ans / B; ans = ans % B * 10; } } else { cout << X + Y << endl; } }