Please help me solve this question

I have used Dijkstra. I’m getting PARTIALLY CORRECT output, subtasks 2 and 3 are failing because of wrong answershttps://www.codechef.com/viewsolution/46472691 and TLE.