Reverse the Rivers

Problem Name:
Reverse the Rivers
Site:CodeForces
Links:
Tags: