This problem is used in private contest:树形结构2