#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, res = 0, cnt = 0;
  long long int *arr;
  cin >> n >> k >> m;
  arr = new long long int[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (int i = 0; i < k; i++) {
    if (cnt == m) {
      res += arr[n - 2];
      cnt = 0;
    } else {
      res += arr[n - 1];
      cnt++;
    }
  }
  cnt = k / (m + 1);
  res = cnt * arr[n - 2] + (k - cnt) * arr[n - 1];
  cout << res;
}
