Descriptions:

Tree Shuffling

CodeForces - 1363E