// __ __ __ _ __ _____
// / //_/__ _____/ /_(_) /__ / ___/__ ________ _
// / ,< / _ `/ __/ __/ / '_/ / (_ / _ `/ __/ _ `/
// /_/|_||_,_/_/ |__/_/_/|_| |___/|_,_/_/ |_, /
// /___/
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define vi vector<int>
#define MOD 1000000007
#define iter(a) for(auto &u : a)
#define f(i, a, b) for(int i = a; i < b; i++)
#define pii pair<int, int>
#define pb push_back
#define all(a) a.begin(), a.end()
void solution() {
int K, n, m, A, B; cin >> K >> n >> m >> A >> B;
vi V(K);
iter(V) cin >> u;
if(K==1){
if(m <= n) cout << m * V[0] << endl;
else cout << n*V[0] - ((m-n)*B + A)<< endl;
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while (t--) {
solution();
}
return 0;
}
/*
____ _ ___ ____ _
| __ )(_) __ _ / _ | / ___| |__ __ _ _ __ ___ _ __
| _ || |/ _` | | | | | | '_ | / _` | '_ ` _ || '_ |
| |_) | | (_| | |_| | |___| | | | (_| | | | | | | |_)|
|____/|_||__, ||___/ |___|_| |_||__,_|_| |_| |_| .__/
|___/ |_|
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |