You are Given N circles on a 2D co-ordinate plane. You are initially standing on the point (X1, Y1) and wish to go to the point (X2, Y2) according to following rules:- — You travel at speed of 1 unit/sec — You incur d damage when you're beyond any of the circular regions for d time. i.e if you spend 0.55 seconds outside the circular region, you suffer from 0.55 damage — The circular regions may overlap
You need to find the minimum damage you can suffer while traveling from starting point to the final point. Answer needs to be truncated to exactly 6 decimal points.
INPUT FORMAT :- The first line contains X1, Y1, X2 and Y2 (The co-ordinates of the starting and end positions) Next line contains integer N, denoting number of circles Each of the next N lines is a 3-tuple wherein the ith line contains Xi, Yi and Ri (the X and Y co-ordinates of the center and the radius of the ith circle)
For instance:- 0 0 2 2
1
1 1 1
One optimal path is to go straight from origin to 2,2. Distance covered outside the circle would be 2 * (sqrt(2) — 1) = 0.828427



