#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> N >> M; vector a(N); for(i=0;i> a[i]; sort(a.begin(),a.end()); ll ans=0; for(i=0;i