#include <bits/stdc++.h>
using namespace std;
vector<long long> divisor(long long n) {
  vector<long long> v;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0)
      if (n / i == i)
        v.push_back(i);
      else {
        v.push_back(i);
        v.push_back(n / i);
      }
  }
  return v;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
vector<long long> sieve() {
  vector<long long> v(1000001);
  int i, j;
  for (i = 0; i < 1000001; i++) v[i] = 1;
  for (i = 2; i <= sqrt(1000001); i++)
    if (v[i] == 1)
      for (j = i * i; j <= 1000000; j += i) v[j] = 0;
  v[1] = 0;
  return v;
}
int main() {
  long long a, b = 31, c, d, e, sum = 0, count = 0, flag = 0, j = 0, i = 1;
  long long x, y;
  b = 0;
  c = 0;
  d = 0;
  set<long long> se;
  long long n, m, t, k, l, r;
  string s;
  vector<long long> v;
  cin >> n >> x;
  long long arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (i = 0; i < n; i++) {
    a = arr[i];
    sum += a * x;
    x--;
    if (x == 0) x = 1;
  }
  cout << sum;
}
