##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
In the land of Repovive, there are cities numbered through , connected by roads that form a tree. Initially, city has soldiers.
Meximus Decimus Meridius wants to maximize the country's total military strength. As you can see on his name, he really likes MEX. So he may perform the following operation as many times as he wishes:
What is the maximum possible value of after any sequence of operations?
No operation can increase the sum. Initially with sum . Operating on the two cities gives , replacing both with and reducing the sum to . So the maximum is the initial sum .
Pair each with a : . After two such operations we get , yielding sum .
it's possible to make