John is standing at the point \((x1, y1)\) in the shopping center which has a path around in the form of a circle with the radius \(r\) and its center located on \((0, 0)\). He has to go to the location \((x2, y2)\) in the shopping center. He wants to find the shortest path he can take to reach the location.
You can consider that John will touch the path around the shopping center and move to the location \((x2, y2)\). Note that he cannot cross the shopping center, but he can (and he must) take the path.
Input
The first and only line contains five space-separated integers \(x1, y1, x2, y2, r(1 \le |x1|, |y1|, |x2|, |y2|, r \le 100)\). It's guaranteed that none of the points is inside the circle, nor on its border.
Output
- Print the minimum distance
- Print the answer with exactly six digits after zero
Sample input #2
-2 0 2 0 1
Sample output #2
4.511299
In the first sample:
In the second sample test:
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor