#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x;
  cin >> n >> x;
  int s[n];
  for (long long int i = 0; i < n; i++) {
    cin >> s[i];
  }
  sort(s, s + n);
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) {
    if (x == 1) {
      sum += s[i];
      continue;
    }
    sum += s[i] * x;
    x--;
  }
  cout << sum;
}
