Descriptions:

Polycarp and Snakes

CodeForces - 1185E