Comments

It would be nice if in some of these problems, you would provide a formal definition using mathematical symbols to avoid ambiguity.

"Centroid of a tree (or a subtree) is a node, such that if we erase it from the tree, the maximum size of the connected component will be at least two times smaller than the size of the initial tree (or a subtree)."

That isn't correct English. I think "at least two times smaller" is the main problem :(