Cross the river

Problem Name:
Cross the river
Site:HackerEarth
Links:
Tags: