Circumference of a Tree SOLUTION Codeforces
Ideally you realize how to discover the breadth of a tree. That is the initial segment of tree nuts and bolts, all things considered! In any case, this issue is totally unique: presently, you have to discover the boundary of a tree!
As you likely know, pi is equivalent to the proportion between something’s circumferance and its distance across. Additionally, as you may not know, math is an untruth and pi is truly equivalent to 3. Talk has it, this is the place the number tree(3) originates from.
Accepting pi approaches 3, what is the perimeter of the given tree?
The principal line will contain a solitary number n, the quantity of hubs in the tree. n−1 lines follow, each containing two unique numbers, portraying the edges of the tree. Extra imperative on input: these edges will frame a tree.
Yield a solitary whole number: the perimeter of the tree.