Fourth Point
InterviewTime limit1sMemory limit128 MB
Given three corners of an axis-aligned rectangle, compute the coordinates of the missing fourth corner.
- Level
Easy2 of 10
- Topics
- Geometry, Math, Implementation
- Solved
- No attempts yet
Problem
You are given the coordinates of three points. Add one more point so that the four points are the vertices of a rectangle whose sides are parallel to the coordinate axes. Find the coordinates of that fourth point.
Input
The coordinates of the three points are given, one point per line. Every coordinate is an integer between 1 and 1000, inclusive.
Output
Print the x-coordinate and y-coordinate of the fourth point that completes the rectangle, separated by a space.