#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
const int INF = 1e9 + 7;
const double eps = 1e-12;
int c[maxn];
int main() {
  int n, x;
  long long ans = 0;
  cin >> n >> x;
  for (int i = 0; i < n; i++) scanf("%d", &c[i]);
  sort(c, c + n);
  for (int i = 0; i < n; i++) {
    int t = max(1, x - i);
    ans += 1ll * c[i] * t;
  }
  cout << ans << endl;
  return 0;
}
