Module Rerooting

Rerooting

**Frequency: 3/10** Reroot the tree to calculate new answer for the new root.

Resources

- [USACO: DP on Trees - Solving For All Roots ](https://usaco.guide/gold/all-roots?lang=cpp)

Problems

Tree distance 178 / 189 1400
Tree distance 2 174 / 174 1500
Tree weight 126 / 132 1600
World tree 16 / 20 2000