Distance between rays
Very hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
On a plane, there are two rays, each defined by a pair of points.
Your task is to calculate the distance between these two rays.
Input
The input consists of four pairs of integers, representing the descriptions of the first and second ray. Each ray is described by the coordinates of its starting point and another point on the ray.
Output
Output a single real number representing the required distance, with a precision of up to the 5-th decimal place.
Examples
Input #1
Answer #1
Submissions 375
Acceptance rate 2%