A9650. Pashmak and Garden
编程题
普及/提高-
知识点
题目描述
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also remembers that there is exactly one tree on each vertex of the square. Now, Pashmak knows the position of only two of the trees. Help him to find the position of two remaining ones.
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also remembers that there is exactly one tree on each vertex of the square. Now, Pashmak knows the position of only two of the trees. Help him to find the position of two remaining ones.
输入格式
The first line contains four space-separated $x_{1},y_{1},x_{2},y_{2}$ $(-100<=x_{1},y_{1},x_{2},y_{2}<=100)$ integers, where $x_{1}$ and $y_{1}$ are coordinates of the first tree and $x_{2}$ and $y_{2}$ are coordinates of the second tree. It's guaranteed that the given points are distinct.
输出格式
If there is no solution to the problem, print -1. Otherwise print four space-separated integers $x_{3},y_{3},x_{4},y_{4}$ that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them.
Note that $x_{3},y_{3},x_{4},y_{4}$ must be in the range $(-1000<=x_{3},y_{3},x_{4},y_{4}<=1000)$ .
Note that $x_{3},y_{3},x_{4},y_{4}$ must be in the range $(-1000<=x_{3},y_{3},x_{4},y_{4}<=1000)$ .
输入输出样例
输入 #1
0 0 0 1
输出 #1
1 0 1 1
输入 #2
0 0 1 1
输出 #2
0 1 1 0
输入 #3
0 0 1 2
输出 #3
-1