#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define debug cerr << "-- " << __LINE__ << " --" << endl
#define MOD 1000000007
#define ALL(o) (o).begin(), (o).end()
typedef long long int ll;

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template <typename T> string to_string(const vector<T> &xs) {string s="["; for(int i=0;i<xs.size();i++) s += (i>0 ? " " : "") + to_string(xs[i]); return s + "]";}
template <typename T> ll argmax(const T &xs) {return distance(xs.begin(), max_element(xs.begin(), xs.end()));}
template <typename T> ll argmin(const T &xs) {return distance(xs.begin(), min_element(xs.begin(), xs.end()));}
ll nextLL(){ll x; scanf("%lld", &x); return x;}
int nextInt(){int x; scanf("%d", &x); return x;}
string nextString(){string s; cin >> s; return s;}



ll extgcd(ll a, ll b, ll &x, ll &y) {
    /* g を返す時点で ax + by == g となる */
    ll g = a; x = 1; y = 0;
    if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
    return g;
}
ll gcd(ll a, ll b) { ll x, y; return extgcd(a, b, x, y); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

class llm{
	ll n;
public:
	llm(){n = 0;}
	llm(ll n){this->n = (n >= 0) ? (n % MOD) : (MOD - 1 - (-n-1 % MOD));}
	operator ll() const {return n;}
	llm operator+(const llm &y) const{ return llm((ll)*this + (ll)y);}
	llm operator+=(const llm &y) { *this = *this + y; return *this;}
	llm operator-(const llm &y) const{ return llm((ll)*this - (ll)y);}
	llm operator-=(const llm &y) { *this = *this - y; return *this;}
	llm operator-() const{ return llm(0) - *this;}
	llm operator*(const llm &y) const{ return llm((ll)*this * (ll)y);}
	llm operator*=(const llm &y) { *this = *this * y; return *this;}
	llm operator/(const llm &y) const{ return *this * y.inv();}
	llm operator/=(const llm &y) { *this = *this / y; return *this;}
	llm inv() const{
		ll x, y;
		if (extgcd(n, MOD, x, y) == 1) return llm(x);
  		return llm(0); // unsolvable
	}
	friend istream& operator >> (istream& os, llm& x);
	friend ostream& operator << (ostream& os, const llm& x);
};
istream& operator >> (istream& is, llm& x){ll n; is >> n; x = llm(n); return is;}
ostream& operator << (ostream& os, const llm& x){os << (ll)x; return os;}

template<typename T> T comb(ll n, ll k){
	T ret = 1;
	for(ll i=1;i<=k;i++) ret = ret * T(n - k + i) / T(i);
	return ret;
}


template<int mod,int proot>
struct NTT{
	vector<long long>pp,invpp;//memoize proot^(mod-1>>i) and inv
	long long power(long long a,int b)
	{
		long long ret=1;
		while(b)
		{
			if(b&1)ret=ret*a%mod;
			a=a*a%mod;
			b>>=1;
		}
		return ret;
	}
	void dft(vector<int>&A,bool sign,int id)
	{
		if(id==0)return;
		int N=1<<id-1;
		vector<int>F(N),G(N);
		for(int i=0;i<N;i++)
		{
			F[i]=A[i<<1];
			G[i]=A[i<<1|1];
		}
		dft(F,sign,id-1);
		dft(G,sign,id-1);
		long long z=(sign?invpp:pp)[id],p=1;
		for(int i=0;i<N;i++)
		{
			A[i]=(F[i]+p*G[i])%mod;
			A[i+N]=(F[i]-p*G[i])%mod;
			if(A[i+N]<0)A[i+N]+=mod;
			(p*=z)%=mod;
		}
	}
	vector<int>multiply(vector<vector<int>> As)
	{
		for(auto &A : As) if (A.empty()) return (vector<int>){};
		/*
		if(A.empty()||B.empty())
		{
			return(vector<int>){};
		}
		*/
		int N=1,sz=0;
		int sizes = 0; for(auto &A : As) sizes += ((int) A.size()) - 1;
		vector<int>ret(sizes+1);
		while(N<ret.size())N<<=1,sz+=1;
		pp.resize(sz+1);
		invpp.resize(sz+1);
		pp[sz]=power(proot,mod-1>>sz);
		invpp[sz]=power(pp[sz],mod-2);
		for(int i=sz-1;i>0;i-=1)
		{
			pp[i]=pp[i+1]*pp[i+1]%mod;
			invpp[i]=invpp[i+1]*invpp[i+1]%mod;
		}
		for(auto &A : As) A.resize(N);
		for(auto &A : As) dft(A,false,sz);
		for(int i=0;i<N;i++){
			for(int j=1;j<As.size();j++){
				As[0][i] = (long long)As[0][i]*As[j][i]%mod;
			}
		}
		dft(As[0],true,sz);
		long long invN=power(N,mod-2);
		for(int i=0;i<ret.size();i++)ret[i]=invN*As[0][i]%mod;
		return ret;
	}
};
vector<int>multiply(vector<vector<int>> As, const int mod){
	/*
	多数個の多項式の乗算を高速に行えます．
	----
	Args:
		As:
			掛けたい多項式の一覧
		mod:
			素数の法．1000000007 や 998244353 などを指定．

	Returns:
		乗算結果の多項式の係数ベクトル．[i] に i 次の係数．

	例：
		{{1, 2}, {1, 3}, {1}}, 1000000007    ->   {1, 5, 6}

	計算量：
		* 2 個の d 次式の積は O(d log d)
		* n 個の d 次式の積は O(n^2 d log (nd)) 
		* 例えば n 個の 1 次式の積は O(n^2 log n) かかるので普通に DP したほうが早い（O(n^2)）．
	*/
	for(auto &A: As){
		for(int&a:A)
		{
			a%=mod;
			if(a<0)a+=mod;
		}
	}
	vector<int>C1=NTT<998244353,3>().multiply(As);
	vector<int>C2=NTT<469762049,3>().multiply(As);
	vector<int>C3=NTT<167772161,3>().multiply(As);
	vector<int>C(C1.size());
	for(int i=0;i<C.size();i++)
	{
		long long v1=C1[i];
		long long v2=(C2[i]-v1)*208783132%469762049;
		if(v2<0)v2+=469762049;
		long long v3=(C3[i]-v1-v2*998244353)%167772161*29562547%167772161;
		if(v3<0)v3+=167772161;
		C[i]=(v1+(v2+v3*469762049)%mod*998244353)%mod;
	}
	return C;
}

pair<ll, ll> CRT(vector<pair<ll, ll>> rms){
	/* Chinese Remainder Theorem */
	assert(!rms.empty());
	for(int i=0;i+1<rms.size();i++){
		/* find r[i] (mod m[i]) and r[i+1] (mod m[i+1]) */
		ll x, y;
		ll g = extgcd(rms[i].second, rms[i+1].second, x, y);
		ll lc = rms[i].second / g * rms[i+1].second;
		ll r = (rms[i].second * rms[i+1].first % lc * x % lc + rms[i+1].second * rms[i].first % lc * y % lc) % lc;
		if (r < 0) r += lc;
		rms[i+1] = make_pair(r, lc);
	}
	return rms[rms.size()-1];
}

/*
ll CRT(vector<ll> r, vector<ll> m){
	// Chinese Remainder Theorem
	assert(r.size() == m.size());
	assert(!r.empty());
	for(int i=0;i+1<r.size();i++){
		// find r[i] (mod m[i]) and r[i+1] (mod m[i+1])
		ll x, y;
		ll g = extgcd(m[i], m[i+1], x, y);
		ll lc = m[i] / g * m[i+1];
		r[i+1] = (m[i] * r[i+1] % lc * x % lc + m[i+1] * r[i] % lc * y % lc) % lc;
		if (r[i+1] < 0) r[i+1] += lc;
		m[i+1] = lc;
	}
	return r[r.size()-1];
}*/

ll N, M;
vector<int> a;


int main(void){
	cin >> N >> M;
	for(int i=0;i<N;i++) a.pb(nextInt());

	vector<vector<int>> polys(2, vector<int>(100001));
	for(int i=0;i<N;i++){
		polys[0][a[i]]++;
		polys[1][a[i]]++;
	}

	ll m1 = 1000000007, m2 = 1000000013;
	vector<int> mul1 = multiply(polys, m1);
	vector<int> mul2 = multiply(polys, m2);

	ll ans = 0;
	for(ll i=200000;i>=0;i--){
		if (M == 0) break;
		ll coef = CRT(vector<pair<ll, ll>>{mp(mul1[i], m1), mp(mul2[i], m2)}).first;
		ll mini = min(coef, M);
		ans += mini * i;
		M -= mini;
	}
	cout << ans << endl;

    return 0;
}




Measured memory_bytes: 9884