The Trap for the Elephantopotamus
Piglet and Winnie-the-Pooh visit Rabbit for tea every morning, always taking the shortest route. However, one day, Winnie-the-Pooh decided to dig a trap for the Heffalump, and Piglet helped him. Now, each morning, they worry about falling into their own trap on the way to Rabbit's house.
Your task is to write a program that calculates the length of the shortest safe path from Winnie-the-Pooh's house to Rabbit's house.
The Heffalump trap is a perfectly circular pit. A path is considered safe if it does not pass through the trap, although it may touch the boundary.
Input
The input file contains the coordinates of Winnie-the-Pooh's house X_B, Y_B, followed by the coordinates of Rabbit's house X_R, Y_R, and then the coordinates of the center and radius of the trap X_T, Y_T, R_T. All coordinates are integers between –32000 and 32000. The radius of the trap is a natural number not exceeding 32000.
Neither Winnie-the-Pooh's house nor Rabbit's house can be inside the trap, but they may be located on its boundary.
Output
Output a single number to the output file — the length of the shortest safe path from Winnie-the-Pooh's house to Rabbit's house, with a precision of at least 4 decimal places.