#PCBBAY0000053. Trung điểm đoạn thẳng (Midpoint of a Segment)
Trung điểm đoạn thẳng (Midpoint of a Segment)
Midpoint of a Segment
Version: Phuoc Hung OJ Extended
Problem Statement
Given segment endpoints and , their midpoint has coordinates and . Print the two coordinates in order, each with exactly 3 decimal places.
Input
The only line contains real numbers , , , , the coordinates of and .
Output
Print and on one line, separated by a space; each value has exactly 3 decimal places.
Subtasks
- Subtask 1 (100 points): .
Examples
Example 1
Input
0 0 2 4
Output
1.000 2.000
Explanation. Substituting 0, 0, 2, 4 into ((x₁+x₂)/2, (y₁+y₂)/2) gives approximately 1, 2. The required output formatting produces 1.000 2.000.
Example 2
Input
1 1 2 2
Output
1.500 1.500
Explanation. Substituting 1, 1, 2, 2 into ((x₁+x₂)/2, (y₁+y₂)/2) gives approximately 1.5, 1.5. The required output formatting produces 1.500 1.500.
Example 3
Input
-3 5 1 -1
Output
-1.000 2.000
Explanation. Substituting -3, 5, 1, -1 into ((x₁+x₂)/2, (y₁+y₂)/2) gives approximately -1, 2. The required output formatting produces -1.000 2.000.