기출 문제 / ACPC 2026 ACPC

Independent Power Grids

There are N towns and M roads. The towns are numbered from 1 to N, and each road connects two different towns in both directions.

The i-th road connects towns ui and vi, and removing it costs ci.

In addition, K of the towns have a power plant.