#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  long long n, x;
  cin >> n >> x;
  ++x;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    if (x > 1) --x;
    ans += a[i] * x;
  }
  cout << ans << endl;
  return 0;
}
