#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int a, b, x, y; cin >> a >> b >> x >> y; cout << fixed << setprecision(15) << max(min((double) x / a * b, (double) y) * (a + b) / b, min((double) y / b * a, (double) x) * (a + b) / a) << endl; return 0; }