#include #include using namespace std; int main() { int A; int B; int L; int R; cin >> L >> R >> A >> B; int ans = 0; if (A < 0) { ans = A * L + B; cout << ans; } else { ans = A * R + B; cout << ans; } }