How to Solve "Cheapest Paths in a Grid" - ZCO 2010

Link Here: https://www.iarcs.org.in/inoi/2010/zco2010/zco2010-2a.php
Hi! Can anybody help me to solve the problem - Cheapest Paths in a Grid?
Any help would be much appreciated. Thanks

Its a standard grid dp problem, google about grid dp problems you will get the solution easily.