eolymp
bolt
Try our new interface for solving problems
Problems

Goat in the Garden - 2

Goat in the Garden - 2

A goat is tied to a peg (in a point \textbf{C}) in a garden with a strong rope of the length \textbf{L} (i.e. a goat may eat a grass that is not farther than \textbf{L} meters from the peg). There is a bed of pineapples that he loves very much. The bed is a line segment with the ends \textbf{A} and \textbf{B}. Humph… We wonder, how much the goat is to stretch the roap in order to reach at least one pine apple? And all the pineapples? \InputFile There are points' \textbf{A}, \textbf{B} and \textbf{C} coordinates and a length of the rope \textbf{L} in the input. All the numbers are integer, \textbf{L} ≥ \textbf{0}, all the coordinates don’t exceed \textbf{10000} by the absolute value. The numbers are separated with spaces or line feeds. \OutputFile The first line should contain the minimal length that the goat is to elongate the rope in order to reach the pineapples bed. The second line should contain the minimal length that the goat is to elongate the rope in order to eat all the pineapples from the bed. All the numbers are to be outputted within \textbf{6} digits after a decimal point.
Time limit 1 second
Memory limit 64 MiB
Input example #1
8 -6 8 6
0 0 7
Output example #1
1.0000000000
3.0000000000
Author Pavel Egorov
Source USU Junior Championship March