Graph Stuff !!!

Limits: 1s, 256 MB

You will be given a tree with n node numbered 1 to n with weighted edge.


This is a companion discussion topic for the original entry at https://toph.co/p/graph-stuff