Spoj PPATH problem.
What is the logic behind this to solve this problem ?
problem link (https://www.spoj.com/problems/PPATH/)
ICPC NA North Central and South Division