#PCBBAY0000052. Khoảng cách hai điểm (Distance between Two Points)
Khoảng cách hai điểm (Distance between Two Points)
Distance between Two Points
Version: Phuoc Hung OJ Extended
Problem Statement
Given two points and in the plane, compute their Euclidean distance . Print exactly 6 decimal places.
Input
The only line contains four real numbers , , , describing the points.
Output
Print the distance between the two points with exactly 6 decimal places.
Subtasks
- Subtask 1 (100 points): .
Examples
Example 1
Input
0 0 3 4
Output
5.000000
Explanation. Substituting 0, 0, 3, 4 into sqrt((x₂-x₁)² + (y₂-y₁)²) gives approximately 5. The required output formatting produces 5.000000.
Example 2
Input
1 1 1 1
Output
0.000000
Explanation. Substituting 1, 1, 1, 1 into sqrt((x₂-x₁)² + (y₂-y₁)²) gives approximately 0. The required output formatting produces 0.000000.
Example 3
Input
-1 -1 2 3
Output
5.000000
Explanation. Substituting -1, -1, 2, 3 into sqrt((x₂-x₁)² + (y₂-y₁)²) gives approximately 5. The required output formatting produces 5.000000.