you give undirected graph consist n vertex a number write vertex number vertex a_i initially edge graphyou add edge graph pay the cost add edge vertex x y a_x a_y coin there m special offer denote number x y w mean add edge connect vertex x y pay w coin you do not use special offer pair vertex x y special offer associate connect vertex pay a_x a_y coin itwhat minimum number coin spend graph connect Recall graph connect possible vertex vertex edge belong graph