Descriptions:

Tree Painting

CodeForces - 1187E