Samsung Question

There is a source (S) and destination (D) and a spacecraft has to go from S to D. There are N number of wormholes in between
which has following properties:

 Each wormhole has an entry and an exit.
 Each wormhole is bi-directional i.e. one can enter and exit from any of the ends.
The time to cross the wormhole is given and the space craft may or may not use the wormhole
to reach D.
The time taken to travel outside wormhole between two points (x1, y1) and (x2, y2) is given by a formula

|x1 - x2| + |y1 - y2|

where, (x1, y1) and (x2, y2) are the co-ordinates of two points.
The co-ordinates of S and D are given and we have to find the minimum time to reach D from S.

Note: It’s not mandatory to consider all the wormholes

sample input: source=(0,0), destination(100,100), warmholes=3 .
coordinates are: (1,2),(120,120)
Sample output=48