I guess there is a "standard" algorithm for problems of this type.. the template would look like this:
given the integer n and n numbers, find the smallest sum you can get by adding the numbers like this:
n1+n2+n1+n2+n3+n1+n2+n3+n4...
the obvious way for me was to do some math on it and get the following;
for n = 5
you get
(n-1)(N1+N2)+(n-2)N3+(n-3)N4+(n-4)N5
so... from this i just thought sorting the array would do...
but it doesn't seem to be the right way... help!!!