~/algor $ cat problems/begin/distance-from-a-point-to-a-line
Distance from a point to a line
Medium
1000 ms
64 MB
37%
A line and a point on the plane are given. Find the shortest distance from the point to the line (the length of the perpendicular); is the absolute value of a number:
Input
The first line has three integers: , and . The second line has two integers: and .
Output
One number — , with exactly 3 digits after the decimal point (for example, 2.000).
Note
and are not both zero.
Examples
Input #1
3 4 -10 0 0
Output #1
2.000
Input #2
1 -1 0 2 2
Output #2
0.000