n cities and
m possible roads and
k temples. The cost of each road is given. Build roads with minimum cost such that each city has access to at least 1 temple.
Note that there can be multiple roads(edges) between two cities and each temple is inside a city.
My attempt : I tried running Kruskal's Algorithm of the graph and then sort edges in descending order and then remove them one by one if the graph still satisfies the condition. I don't know this algorithm is correct or not.
I found this question in an algorithm book.