I have tried these problem.(link). But I am stuck still now after getting the hint (Dijkstra+ BFS). Can anybody please provide me with an editorial(algorithm)? What do we need to do to solve this problem?
I mean it would be better "if some one provides me with the thinking process". Thanks.