CF1187E Tree Painting
Description
You are given a tree (an undirected connected acyclic graph) consisting of $ n $ vertices. You are playing a game on this tree.
Initially all vertices are white. On the first turn of the game you choose one vertex and paint it black. Then on each turn you choose a white vertex adjacent (connected by an edge) to any black vertex and paint it black.
Each time when you choose a vertex (even during the first turn), you gain the number of points equal to the size of the connected component consisting only of white vertices that contains the chosen vertex. The game ends when all vertices are painted black.
Let's see the following example:

Vertices $ 1 $ and $ 4 $ are painted black already. If you choose the vertex $ 2 $ , you will gain $ 4 $ points for the connected component consisting of vertices $ 2, 3, 5 $ and $ 6 $ . If you choose the vertex $ 9 $ , you will gain $ 3 $ points for the connected component consisting of vertices $ 7, 8 $ and $ 9 $ .
Your task is to maximize the number of points you gain.
Input Format
N/A
Output Format
N/A
Explanation/Hint
The first example tree is shown in the problem statement.