The Cybermen and the Daleks have long been the Doctor's main enemies. Everyone knows…
- User
The Cybermen and the Daleks have long been the Doctor's main enemies. Everyone knows that both these species enjoy destroying everything they encounter. However, a little-known fact about them is that they both also love taking Turing tests!
Heidi designed a series of increasingly difficult tasks for them to spend their time on, which would allow the Doctor enough time to save innocent lives!
The funny part is that these tasks would be very easy for a human to solve.
The first task is as follows. There are some points on the plane. All but one of them are on the boundary of an axis-aligned square (its sides are parallel to the axes). Identify that point. Input
The first line contains an integer n (2 ≤ n ≤ 10).
Each of the following 4n + 1 lines contains two integers x_i, y_i (0 ≤ x_i, y_i ≤ 50), describing the coordinates of the next point.
It is guaranteed that there are at least n points on each side of the square and all 4n + 1 points are distinct.
Output
Print two integers — the coordinates of the point that is not on the boundary of the square.
Examples
Input
2 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2
Output
1 1
Input
2 0 0 0 1 0 2 0 3 1 0 1 2 2 0 2 1 2 2
Output
0 3
Note
In both examples, the square has four sides x=0, x=2, y=0, y=2.
Assistant
n = int(input()) points = [tuple(map(int, input().split())) for _ in range(4 * n + 1)] for candidate in points: temp = [pt for pt in points if pt != candidate] min_x = min(p[0] for p in temp) max_x = max(p[0] for p in temp) min_y = min(p[1] for p in temp) max_y = max(p[1] for p in temp) if (max_x - min_x) != (max_y - min_y): continue valid = True for x, y in temp: if not (x == min_x or x == max_x or y == min_y or y == max_y): valid = False break if not valid: continue left = right = bottom = top = 0 for x, y in temp: if x == min_x and min_y <= y <= max_y: left += 1 if x == max_x and min_y <= y <= max_y: right += 1 if y == min_y and min_x <= x <= max_x: bottom += 1 if y == max_y and min_x <= x <= max_x: top += 1 if left >= n and right >= n and bottom >= n and top >= n: print(candidate[0], candidate[1]) break
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.