CF459A.Pashmak and Garden

普及-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

帕什马克一年前就爱上了名叫帕尔米达的一位漂亮女孩……

今天,帕什马克与他的伴侣在一座浪漫的花园中约会。不幸的是,帕什马克忘记了这座花园的位置。但他记得,这座花园呈正方形,且其四边均与坐标轴平行。他还记得,正方形的每个顶点上恰好有一棵树。现在,帕什马克只知道其中两棵树的位置。请帮助他找出另外两棵树的位置。

输入格式

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.

第一行包含四个以空格分隔的整数 x1, y1, x2, y2x_1,\ y_1,\ x_2,\ y_2(−100≤x1, y1, x2, y2≤100-100 \le x_1,\ y_1,\ x_2,\ y_2 \le 100),其中 x1x_1 和 y1y_1 是第一棵树的坐标,x2x_2 和 y2y_2 是第二棵树的坐标。保证所给的两个点互不相同。

输出格式

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).

如果问题无解,输出 -1。否则输出四个以空格分隔的整数 x3, y3, x4, y4x_3,\ y_3,\ x_4,\ y_4,分别表示另外两棵树的坐标。若存在多个解,输出任意一个即可。

注意:x3, y3, x4, y4x_3,\ y_3,\ x_4,\ y_4 必须满足范围 −1000≤x3, y3, x4, y4≤1000-1000 \le x_3,\ y_3,\ x_4,\ y_4 \le 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

输入解题思路,AI测评打分。不知道怎么写?

首页