PROGRAMMING:House splitting
The factory director bought a whole house as a workshop and now plans to divide the whole house into several workshops. The decoration company stipulates that the price of the split house is equal to the area of the split house. If you want to split a room with an area of 200 into three workshops with an area of 80, 70 and 50, it costs 200 to split the house into two rooms with an area of 120 and 80 for the first time, and it costs 120 to split the room with an area of 120 into two rooms with an area of 70 and 50 for the second time, and the total cost is 320. If another scheme is adopted, the first time the house with an area of 200 is divided into 150 and 50, the cost is 200, and the second time the room with an area of 150 is divided into 80 and 70, the cost is 150, the total cost is 350. Obviously, the first one costs less. Please write a program for the factory director to design the least cost splitting scheme.
###Input format:
The input is two lines. The first line is an integer n, which represents the number of workshops required. The second line is n positive integers separated by spaces to give the required area of each workshop. N is not more than 100000, and the final result is less than $$2 ^ {31} $$.
###Output format:
The output is an integer indicating the minimum cost of dividing the whole house into n workshops.
###Input example:
```in
eight
1 1 1 1 2 3 4 5
```
###Output example:
```out
forty-nine
```
answer:If there is no answer, please comment
###Input format:
The input is two lines. The first line is an integer n, which represents the number of workshops required. The second line is n positive integers separated by spaces to give the required area of each workshop. N is not more than 100000, and the final result is less than $$2 ^ {31} $$.
###Output format:
The output is an integer indicating the minimum cost of dividing the whole house into n workshops.
###Input example:
```in
eight
1 1 1 1 2 3 4 5
```
###Output example:
```out
forty-nine
```
answer:If there is no answer, please comment