Given a tree.
Tree is an undirected connected acyclic graph. Wiki
You should add exactly one edge to the tree so that, total number of articulation points of the resulting graph is minimized. Note that, resulting graph can have self loops or duplicate edges.
Articulation points of a graph are those nodes, if you we delete one of those, the graph will be disconnected means, will have more than one connected component!
The first line will contain T ( number of test cases, ).
For each test case there will be n ( number of nodes in the tree, ) and following n-1 lines will contain (), which means there is an edge between and on the tree.
It is guaranteed that, the tree is a valid. <br
For each test case you've to print two integers a b if you add an edge between nodes a and b then resulting graph will have minimum articulation points.
There can be multiple possible solutions, you can print any one of them.
Remember, for that particular test case.
1 5 1 5 1 3 1 2 3 4