#include <bits/stdc++.h>
using namespace std;
//큰수의 법칙
int main()
{
int n;
cin >> n;
int k,m;
cin >> m >> k;
int max = -3200;
int smax;
int a[100];
for(int i=0; i<n; i++){
cin >> a[i];
}
//////////////
//sort -> max, smax구하자
sort(a,a+n);
max = a[n-1];
smax = a[n-2];
//////////////
int cnt=0;
int ans=0;
for(int i=0; i<100; i++){
if(cnt < m){
if(i<k){
ans= ans+max;
cnt++;
}
else{
cout << i << " = i \n";
ans= ans+smax;
cnt++;
i=0;
}
}
else{
break;
}
}
cout << cnt << " = cnt \n";
cout << ans;
return 0;
}