#include using namespace std; int main() { double A, B, X, Y; cin >> A >> B >> X >> Y; if(A==B) cout << min(X, Y)*2 << endl; else if(AB){ if(X*B/A