A9650 | Pashmak and Garden
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted