#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T input() {
  T n = 0;
  int s = 1;
  char p = getchar();
  while ((p < '0' || p > '9') && p != EOF && p != '-') p = getchar();
  if (p == '-') {
    s = -1, p = getchar();
  }
  while (p >= '0' && p <= '9') {
    n = (n << 3) + (n << 1) + (p - '0');
    p = getchar();
  }
  return n * s;
}
int main(int argc, char** argv) {
  long long int n, x;
  n = input<long long int>();
  x = input<long long int>();
  long long int c[100009];
  for (int i = 0; (i) < (n); ++i) {
    c[i] = input<long long int>();
  }
  sort(c, c + n);
  long long int done = 0;
  long long int ans = 0;
  while (done != n) {
    ans += (c[done] * x);
    done++;
    x--;
    if (!x) x = 1;
  }
  cout << ans << endl;
  return 0;
}
