#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<map>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<stack>
#include<math.h>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<complex>
#include<assert.h>
#include<math.h>
#include<memory.h>
#include <stdlib.h>
#include<functional>
#include<sstream>
#include<cstdio>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define repi(i,a,n) for(int i=a;i<n;i++)
 
#define mp make_pair
#define pb push_back
#define fastIO ios::sync_with_stdio(false)
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#define scf(xx) scanf("%d",&xx)
#define scfl(xx) scanf("%I64d",&xx)
#define All(a) a.begin(), a.end()
#define LSOne(S) (S & (-S))
#define NIL 0
#define INF (1<<28)
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef long double ld;
 
 
int dx[] = { 0, 1, 0, -1, -1, -1, 1, 1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
 
typedef complex<long double> Complex;
typedef vector<Complex> ComplexVector;
 
const double PI = 2.0 * acos(0.0);
 
// Given a n-th polynomial p, return its values at
// w^0, w^1, .., w^(n-1). n is assumed to be a power of 2.
// Since the size of the input and output are the same, the output is stored at
// p.
void dft(ComplexVector& p, Complex w) {
	int n = p.size();
	if (n == 1) return;
 
	// divide
	ComplexVector even(n / 2), odd(n / 2);
	for (int i = 0; i < n / 2; ++i) {
		even[i] = p[i * 2];
		odd[i] = p[i * 2 + 1];
	}
 
	// conquer
	dft(even, w * w);
	dft(odd, w * w);
 
	// merge
	Complex w_power = 1;
	for (int i = 0; i < n / 2; ++i) {
		Complex offset = w_power * odd[i];
		p[i] = even[i] + offset;
		p[i + n / 2] = even[i] - offset;
		w_power *= w;
	}
}
 
 
// returns smallest power of 2 s.t. p2 >= n.
int roundUp(int n) {
	int p2 = 1;
	while (p2 < n) p2 *= 2;
	return p2;
}
 
vector<ll> multiply(const vector<ll>& a, const vector<ll>& b) {
	// last *2 is needed because C can have twice the degree from original polys
	int n = roundUp(max(a.size(), b.size())) * 2;
 
	// Complex representations of a and b
	ComplexVector ac(a.begin(), a.end()), bc(b.begin(), b.end());
	ac.resize(n);
	bc.resize(n);
 
	// FFT
	Complex w = polar(1.0, 2 * PI / n);
	dft(ac, w);
	dft(bc, w);
	// Pointwise multiplication
	for (int i = 0; i < n; ++i)
		ac[i] *= bc[i];
 
	// Inverse FFT
	dft(ac, polar(1.0, -2 * PI / n));
	for (int i = 0; i < n; ++i)
		ac[i] /= double(n);
 
	// Trim zero paddings
	while (!ac.empty() && fabs(real(ac.back())) < 1e-9)
		ac.pop_back();
 
	// return real
	vector<ll> ret(ac.size());
	for (int i = 0; i < (int)ac.size(); ++i)
		ret[i] = llround(real(ac[i]));
 
	return ret;
}
void solve(){
	int n; 
	cin>>n; 
	ll m;
	cin>>m;
	vector<ll>a,b;
	for(int i=1;i<=2e5;i++){
		a.pb(0);
		b.pb(0);
	}
	for(int i=0;i<n;i++){
		int x; 
		cin>>x;
		a[x]++;
		b[x]++;
	}
	vector<ll>res;
	res = multiply(a,b);
	int sz = res.size();
	ll ans = 0;
	for(ll i=sz-1;i>=0;i--){
		ll d = min(res[i],m);
		m-=d;
		ans+=d*i;
	}
	cout<<ans<<endl;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1; 
//	cin>>t; 
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 72180