Codeforces - 600E 树上启发式合并

NoSuchKey