#include using namespace std; double a, b, x, y; void input() { cin >> a >> b >> x >> y; } void solve() { cout << (double)(a + b) * (min(x / a, y / b)) << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(12); input(); solve(); }