Back
Close

Crush vs Friend

Statement

 Goal

Help Jack Goff find a seat in classroom which is at equal distance from his friend Bob and crush Erica such that he's as near to them as possible.
It is guaranteed that a seat always exist in middle of Bob and Erica, as they are either sitting in the same row or same column or sitting diagonally to each other.
Input
The first line contains row and column number of Bob's seat: rb cb
The second line contains row and column number of Erica's seat: re ce
Output
Output the row and column number of Jack's seat: rj cj
Constraints
1≤ rb, cb, re, ce ≤ 10
Example
Input
1 3
3 1
Output
2 2

Game modes
Fastest, Shortest

Test cases
simple diagonal Test
Input
1 3 3 1
Output
2 2

diagonal simple Validator
Input
1 5 5 1
Output
3 3

big diagonal Test
Input
9 10 1 2
Output
5 6

smaller diagonal Validator
Input
5 1 1 5
Output
3 3

same row Test
Input
2 1 2 5
Output
2 3

same row again Validator
Input
5 3 5 7
Output
5 5

Tricky part Test
Input
3 1 5 3
Output
4 2

Trickier Validator
Input
2 1 6 5
Output
4 3

Solution language

Solution

Stub generator input