Make It Connected
HardRating 1900CodeforcesGraph Theory (MST, SCC, Bridges)
Approach hintTry it first, then revealHide
Without offers, the best tree is a star centred at the vertex with the smallest a. Add those n - 1 star edges to the special offers and run Kruskal on the combined edge list.