Codeforces Round #363 (Div. 2) D. Fix a Tree(greedy+dsu)

NoSuchKey