Hello all, So I came across this problem about Graph Theory and I am still not sure on how to solve this. https://vjudge.net/contest/78376#problem/B
I tried thinking about MST however what to do if in the final solution there are more than the number of connected components? MST will be taking the whole graph as a single component.