#include <bits/stdc++.h>
unsigned long long int a[100000], L[100000], R[100000];
void merge(unsigned long long int a[], int f, int l, int m) {
  int i, j, k, n1, n2;
  n1 = m - f + 1;
  n2 = l - m;
  for (i = f, j = 0; i <= m; i++, j++) L[j] = a[i];
  for (i = m + 1, j = 0; i <= l; i++, j++) R[j] = a[i];
  for (i = 0, j = 0, k = f; i < n1 && j < n2; k++) {
    if (L[i] <= R[j])
      a[k] = L[i++];
    else
      a[k] = R[j++];
  }
  while (i < n1) a[k++] = L[i++];
  while (j < n2) a[k++] = R[j++];
  return;
}
void sort(unsigned long long int a[], int f, int l) {
  if (f < l) {
    int m = (f + l) / 2;
    sort(a, f, m);
    sort(a, m + 1, l);
    merge(a, f, l, m);
  }
  return;
}
void Msort(unsigned long long int a[], int n) {
  int f = 0, l = n - 1;
  sort(a, f, l);
  return;
}
int main() {
  int n, x;
  unsigned long long int s = 0;
  scanf("%d%d", &n, &x);
  int i, j;
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  Msort(a, n);
  for (i = 0; i < n; i++) {
    s += (a[i] * x) % 1000000000000;
    if (x > 1) x--;
  }
  printf("%llu\n", s);
  return 0;
}
