Poltu and Minimum Spanning Tree

Boltu gave a simple task to his best friend Poltu. You are a good programmer. So, Poltu hired you to solve the given task.


This is a companion discussion topic for the original entry at https://toph.co/p/poltu-and-minimum-spanning-tree