Description: Programming combines fruit
For example, there are 3 kinds of fruit, the number is 1, 2, 9. The merger scheme is as follows:
1. combined 1 and 2, the new heap number is 3, and the physical strength is 3.
2. combine the new heap with the third heap, and get the new heap, the number is 12, the energy consumption is 12.
3. of the total physical exertion was 3 + 12 = 15, and 15 could be proved to be the minimum physical exertion value.
input
The input consists of two rows, and the first line is an integer n (1< = n<=10000) indicating the number of fruits. The second line contains n integers, separated by spaces. The first I integer AI (1< = ai<=10000) is the number of the first I species.
To Search:
File list (Check if you may need any files):
apple\apple\apple.cpp
apple\apple\apple.vcxproj
apple\apple\apple.vcxproj.filters
apple\apple\Debug\apple.log
apple\apple\Debug\apple.obj
apple\apple\Debug\apple.pch
apple\apple\Debug\apple.tlog\apple.lastbuildstate
apple\apple\Debug\apple.tlog\CL.read.1.tlog
apple\apple\Debug\apple.tlog\CL.write.1.tlog
apple\apple\Debug\apple.tlog\link.read.1.tlog
apple\apple\Debug\apple.tlog\link.write.1.tlog
apple\apple\Debug\stdafx.obj
apple\apple\Debug\vc120.idb
apple\apple\Debug\vc120.pdb
apple\apple\ReadMe.txt
apple\apple\stdafx.cpp
apple\apple\stdafx.h
apple\apple\targetver.h
apple\apple.sdf
apple\apple.sln
apple\apple.v12.suo
apple\Debug\apple.exe
apple\Debug\apple.ilk
apple\Debug\apple.pdb
apple\ipch\apple-b4c4e286\apple-368c7bbe.ipch
apple\apple\Debug\apple.tlog
apple\apple\Debug
apple\ipch\apple-b4c4e286
apple\apple
apple\Debug
apple\ipch
apple