#P7840. 「C.E.L.U-03」重构
「C.E.L.U-03」重构
Description
Luo Siji has servers, and each server has a busyness value . Luo Siji will connect them together using network links, so each server will have a degree , which is the number of connected links. The total running time of this server network is . Please minimize this value.
Input Format
The first line contains one integer, .
The second line contains integers, where the -th integer represents .
Output Format
The first line contains one integer, the answer.
4
2 3 4 4
28
Hint
Sample Explanation:
Connect three edges . The degrees are , respectively.
| Testdata ID | Special Property | |
|---|---|---|
| None | ||
| All are equal | ||
| None | ||
Constraints: For of the testdata, and .
Translated by ChatGPT 5
京公网安备 11011102002149号