There are

iron balls numbered

to

, and the weight of the

th ball is

. We use

springs to connect them into a tree.
The ball numbered

is the root of the tree. Now we grasp the root and hang the whole tree.
The initial length of each spring is

. If the weight of the subtree it hangs is

, its length will become

.
At this time, PaiGuDragon come up with an evil idea. It plans to rearrange the

sequence, that is, PaiGuDragon is going to generate an array

which is a permutation of

, and then the weight of the

th ball will become
Considering all the arrangements, what is the maximum of maximum depth of the tree after hanging?
Here, the maximum depth is defined as the maximum value of the sum of the spring lengths on the path from the leaf to the root.