#include #define rep(i,a,n) for (int i = a;i < n;i++) using namespace std; int main() { double a, b, x, y; cin >> a >> b >> x >> y; if (x / a * b <= y){ printf("%f", x + x / a * b); }else{ printf("%f", y + y / b * a); } }