Is there something wrong with the answer of sample case of DISTCHOC

problem code- DISTCHOC
the answer of sample input should be 11 not 18 i dont understand what they are asking.
PLZ HELP

first sort this and then add them to make minimum time but mine too not running

pls don’t tell the solution during the on going contest it will not help him in developing his coding skills.

##take help from this code

#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
ll n;
cin>>n;
ll m=n-1;
ll a[n];
for(ll i=0;i<n;i++) {
cin>>a[i];
}
sort(a,a+n);
ll sum = 0;
for(ll i=0;i<n-1;i++)
{
sum += m*a[i];
m–;
}
cout<<sum<<endl;
}