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.
If talking about MST then, I think Kruskal might work, but not Prim. Am I right?