Problem E
Intersection is not that Easy
Input: Standard Input
Output: Standard Output
Time Limit: 1 Second
In this problem your job is to find the distance between two lines or a line and a line segment or two line segments. Suppose we have two points A(x_{1},y_{1}) and B(x_{2},y_{2}) on a two dimensional Cartesian plane. If we connect A and B then we get line segment AB. But if we connect AB and extend it on both side at infinite length then we get line AB.
For each set of input you should produce one line of output which
contains a single floating-point number indicating the distance between the two
lines or line segments or the distance between one line and one line segment.
This floating-point number contains five digits after the decimal point. Errors
less than 2e-5 will be
ignored.
10 10 20 20 L -10 –10 19 19 L 10 10 12 13 LS 11 11 19 20 LS 10 10 12 12 END 11 11 23 34 END |
0.00000 0.27735 |
Problem setter: Shahriar Manzoor, EPS.
Special Thanks: Derek Kisman, EPS.