#PCBBAY0000012. Hệ số góc đường thẳng (Line Slope)
Hệ số góc đường thẳng (Line Slope)
Line Slope
Version: Phuoc Hung OJ Extended
Problem Statement
A line passes through points and with distinct -coordinates. Its slope is . The input guarantees . Compute the slope and print exactly 6 digits after the decimal point.
Input
The only line contains real numbers , , , giving the two points in order.
Output
Print slope with exactly 6 decimal places.
Subtasks
- Subtask 1 (100 points): All coordinates are finite; .
Examples
Example 1
Input
0 0 2 4
Output
2.000000
Explanation. The vertical difference is 4 and the horizontal difference is 2. Their quotient is 2; six-decimal formatting gives 2.000000.
Example 2
Input
1 3 4 0
Output
-1.000000
Explanation. The vertical difference is -3 and the horizontal difference is 3. Their quotient is -1; six-decimal formatting gives -1.000000.
Example 3
Input
-1 -1 1 0
Output
0.500000
Explanation. The vertical difference is 1 and the horizontal difference is 2. Their quotient is 0.5; six-decimal formatting gives 0.500000.