Spoj PPATH problem.
What is the logic behind this to solve this problem ?
problem link (https://www.spoj.com/problems/PPATH/)
Atcoder ABC #354 Solution Discussion