Distance from the point
Easy
Execution time limit is 1 second
Runtime memory usage limit is 122.174 megabytes
Three points A, B` and C are given.
Find the distance from point C to the line, ray and segment, formed with points A and B.
Input
First line contains two integers - the coordinates of point C. Next two lines in the same format contains points A and B (A ≠ B). All input integers are not greater than 10000.
Output
In the first line print one real number - the distance from point C to the line. In the next two lines print the distance from the ray AB (A is the ray starting point) and from the segment AB. Print all numbers with accuracy not greater than 10^(-6)
. The ray is directed from point A to point B.
Examples
Input #1
Answer #1
Submissions 277
Acceptance rate 22%