Read the problem statement carefully. Note the input format: number of nodes, number of edges, and a list of edges with weights. The output is a single number: the minimum repair cost. If you cannot connect all cities, output "IMPOSSIBLE". Think about what "IMPOSSIBLE" means. When is the graph disconnected?
How do you detect this after running Kruskal? The edge count in the MST tells you everything.