intmain(){ cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> a[i]; Q.push(Queue(1, a[i])); } for (int i = 1; i <= m - n; ++i) { Queue u = Q.top(); Q.pop(); Q.push(Queue(u.k + 1, u.v)); } ll ans = 0; while (!Q.empty()) { Queue u = Q.top(); Q.pop(); ans += calc(u.k, u.v); } cout << ans << endl; return0; }