Move Back at a Cost

Problem Name:
Move Back at a Cost
Site:CodeForces
Links:
Tags: