Back
Close

Fourth vertex of square

Statement

 Goal

Given the coordinates of the three vertices of the square, find the coordinates of the fourth vertex.
Input
3 lines: Two space separated integers x and y for the coordinates of one vertex.
Output
Two space separated integers x and y for the coordinates of fourth vertex
Constraints
-100 < x,y < 100
Example
Input
1 1
1 5
5 5
Output
5 1

Game modes
Shortest

Test cases
Example Test
Input
1 1 1 5 5 5
Output
5 1

Validator 1 Validator
Input
2 2 2 4 4 4
Output
4 2

Negative coordinates Test
Input
3 -1 -4 -1 -4 6
Output
3 6

Validator 2 Validator
Input
2 -3 -6 -3 -6 5
Output
2 5

Rotated Test
Input
1 5 4 2 7 5
Output
4 8

Validator 3 Validator
Input
2 5 4 3 6 5
Output
4 7

Rotated other way Test
Input
-1 -1 -2 5 4 6
Output
5 0

Validator 4 Validator
Input
-2 -1 7 -4 10 5
Output
1 8

Wrong order? Test
Input
2 2 2 3 3 2
Output
3 3

Validator 5 Validator
Input
3 5 5 5 3 3
Output
5 3

Complete test Test
Input
-2 3 4 -1 -1 -2
Output
3 4

Validator 6 Validator
Input
3 5 -6 0 -4 7
Output
1 -2

Solution language

Solution

Stub generator input