{ll@n,s=0;VI@a(n);rsortV(a);rep(i,n)s+=a[i]*Ilog2_f(i+1);wt(s);}