#include <cassert>
#include "limits.h"
#include <limits>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
#include <memory>
#include <utility>
 
#define rep(i, a, b) for (long long (i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug " <<"LINE:"<<__LINE__<<"  "<< #i <<":"<< i << std::endl

 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
long long pow_mod(long long a, long long b, long long mod=-1) {
  if ((a == 0)||(mod!=-1&&a%mod==0)) {
    return 0;
  }
 
  long long x = 1;
 
  while (b > 0) {
    if (b & 1) {
      x = (mod!=-1)?(x * a) % mod:x*a;
    }
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}
 
// const long long MOD = 998244353;
const long long MOD = 1e9 + 7;

//原始根を使うFFT 法をとっていることに注意
// max_dには多項式2つの次数の積より大きい2^nを渡す
template <long long modu, long long root>
class NumberTheoreticTransform {
  /*
   modとrootと次数の最大値の組
   1224736769 , 3 , 2^24
   998244353 , 3 , 2^23
  */

 using ll=long long;

 private:

  ll pow_mod(ll a, ll b, ll mod) {
    if (a % mod == 0) {
      return 0;
    }

    ll x = 1;

    while (b > 0) {
      if (b & 1) {
        x = (x * a) % mod;
      }
      a = (a * a) % mod;
      b >>= 1;
    }
    return x;
  }

  std::vector<ll> zeta, temp;
  ll size = 1;

  public:

  std::vector<ll> fft(std::vector<ll>& a, bool inv = false) {
    ll mask = size - 1;
    ll p = 0;
    for (ll i = size >> 1; i >= 1; i >>= 1) {
      auto& cur = (p & 1) ? temp : a;
      auto& nex = (p & 1) ? a : temp;
      ll e = zeta[inv ? (size - i) % size : i];
      ll w = 1;
      for (ll j = 0; j < size; j += i) {
        for (ll k = 0; k < i; k++) {
          nex[j + k] = (cur[((j << 1) & mask) + k] +
                        w * cur[(((j << 1) + i) & mask) + k]) %
                       modu;
        }
        w = (w * e) % modu;
      }
      p++;
    }
    if (p & 1) std::swap(a, temp);
    if (inv)
      for (ll i = 0; i < size; i++)
        a[i] = (a[i] * pow_mod(size, modu - 2, modu)) % modu;
    return a;
  }

  std::vector<ll> mul(std::vector<ll>& a, std::vector<ll>& b) {
    ll m = a.size() + b.size() - 1;
    size = 1;
    while (m > size) {
      size <<= 1;
    }
    ll ze = pow_mod(root, (modu - 1) / size, modu);
    temp.resize(size);
    zeta.resize(size);
    zeta[0] = 1;
    for (ll i = 1; i < size; i++) zeta[i] = (zeta[i - 1] * ze) % modu;
    std::vector<ll> A(size), B(size);
    for (ll i = 0; i < a.size(); i++) A[i] = a[i];
    for (ll i = 0; i < b.size(); i++) B[i] = b[i];

    A = fft(A);
    B = fft(B);
    for (ll i = 0; i < size; i++) A[i] = (A[i] * B[i]) % modu;
    A = fft(A, true);
    A.resize(m);
    return A;
  }
};

using ll = long long;
using P = std::pair<long long,long long>;



int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  NumberTheoreticTransform<1224736769,3> ntt1;
  NumberTheoreticTransform<998244353 , 3> ntt2;

  ll n,m;
  std::cin>>n>>m;

  std::vector<ll> a(100001,0);

  rep(i,0,n){
    ll temp;
    std::cin>>temp;
    a[temp]++;
  }

  std::vector<ll> sum1=ntt1.mul(a,a),sum2=ntt2.mul(a,a);

  ll ans=0;
  for(ll i=sum1.size()-1;i>=0;i--){
    ll sum=sum1[i];
    while(sum%998244353!=sum2[i])sum+=1224736769;
    if(m>=sum){
      m-=sum;
      ans+=sum*i;
    }else{
      ans+=i*m;
      break;
    }
  }


  std::cout<<ans<<"\n";

  return 0;
}

Measured memory_bytes: 17524