Full Solution:

- At first get the shortest path tree rooted at S using Dijkstra.Now what we observe is if those edges which are not there in the shortest path tree are deleted ,then it wont affect our result.Also if any edge in the shortest path tree which don't lie on the path from S to T are deleted,then also our answer wont change.
- Now what happens when we delete one of the edge of the shortest path tree is that the tree gets decomposed into two components.

Now imagine how our shortest path from S to T will look like.Let's denote the component in which S lies by A and the component in which T lies by B.Its not possible to reach T without entering the component B(as T lies in component B and S in component A).Consider the earliest moment when we reach component B from A,let that edge ...