Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/begin/distance-from-a-point-to-a-line

Distance from a point to a line

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Medium 1000 ms 64 MB 37%
Share

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:

A line and point M on the coordinate plane; the perpendicular d dropped from M to the line

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

Sign in to submit a solution

Signing up is free and takes a minute.