题干:

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.

Input

The first line contains four space-separated x1, y1, x2, y2 ( - 100 ≤ x1, y1, x2, y2 ≤ 100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2are coordinates of the second tree. It's guaranteed that the given points are distinct.

Output

If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3, y3, x4, y4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them.

Note that x3, y3, x4, y4 must be in the range ( - 1000 ≤ x3, y3, x4, y4 ≤ 1000).

Examples

Input
0 0 0 1

Output
1 0 1 1

Input
0 0 1 1

Output
0 1 1 0

Input
0 0 1 2

Output
-1

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.

Input

The first line contains four space-separated x1, y1, x2, y2 ( - 100 ≤ x1, y1, x2, y2 ≤ 100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct.

Output

If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3, y3, x4, y4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them.

Note that x3, y3, x4, y4 must be in the range ( - 1000 ≤ x3, y3, x4, y4 ≤ 1000).

Examples

Input
0 0 0 1

Output
1 0 1 1

Input
0 0 1 1

Output
0 1 1 0

Input
0 0 1 2

Output
-1

解题报告:

ac代码:

#include<bits/stdc++.h>using namespace std;int main()
{int x1,x2,y1,y2;int d;cin>>x1>>y1>>x2>>y2;if(x1==x2) {d=abs(y1-y2);printf("%d %d %d %d\n",x1+d,y1,x2+d,y2);}else if(y1==y2) {d=abs(x1-x2);printf("%d %d %d %d\n",x1,y1+d,x2,y2+d);}else {if(abs(x1-x2) != abs(y1-y2) ) {printf("-1\n");}else printf("%d %d %d %d\n",x1,y2,x2,y1);}return 0 ;
}

总结:

【CF#459 A 】Pashmak and Garden (水题)相关推荐

  1. CF Round #426 (Div. 2) The Useless Toy 思维 水题

    题目链接: http://codeforces.com/contest/834/problem/A 题目描述: 输入起始状态和结束状态和数列长度, 判断旋转方向是顺时针逆时针还是不合理 解题思路: 长 ...

  2. 【Educational CF Round 86 (Rated for Div. 2) / 1342 A + B】- A. Road To Zero + B. Binary Perio - 水题

    目录 A. Road To Zero 题目大意 思路 代码 B. Binary Period 题目大意 思路 代码 A. Road To Zero time limit per test :1 sec ...

  3. 22.10.25补卡 一堆cf水题

    被骂了, 写点水题泄泄愤 Problem - A - Codeforces 贪心, 排一下序, 每次选最大的, 选的同时记录一下已经拿了多少个硬币 /* ⣿⣿⣿⣿⣿⣿⡷⣯⢿⣿⣷⣻⢯⣿⡽⣻⢿⣿⣿⣿⣿⣿⣿ ...

  4. 【牛客 - 318L】彪神666(水题,半高精度,递推,trick)

    题干: 在国外,666代表魔鬼,777代表上帝. 所以牛逼的彪神就非常不喜欢6这个数字. 有一天彪神突发奇想,,他想求一些书与6无关的数. 如果一个数能被6整除,或者它的十进制表示法中某位上的数字为6 ...

  5. Coderforces 字符串水题合集

    今天我们聊聊 Coderforces 字符串水题合集. 字符串就是string. 这是string的百度翻译,我们要谈的是画框的.↓ string是C++.java.VB等编程语言中的字符串,字符串是 ...

  6. 2014ACM/ICPC亚洲区广州站- HDU-5127~5137,B(暴力+几何)E(签到水题)K(Dijkstra板子)

    已经开始挖区域赛的坑了,CF已经不够打了,其实CF打不动了. 一点一点写吧,看看最后能写多少. B-The E-pang Palace(暴力+几何) 题目链接:http://acm.hdu.edu.c ...

  7. 水题/poj 1852 Ants

    1 /* 2 PROBLEM:poj1852 3 AUTHER:Nicole 4 MEMO:水题 5 */ 6 #include<cstdio> 7 using namespace std ...

  8. HDU2673-shǎ崽(水题)

    如果不能够直接秒杀的题,就不算水题.又应证了那句话,有时候,如果在水题上卡住,那么此题对于你来说,也就不算是水题了额~~ 刚睡醒,迷迷糊糊. 题目的意思很简单,求一个最大的,再求一个最小的.几乎是什么 ...

  9. 图论刷水题记录(二)(最短路-----SPFA算法)

    继第一篇的后续,又来刷水题了,写的是SPFA算法,这个算法的复杂度比较玄学,感觉能不用就不用了,但是他的好处就是可以判断负圈. 3月26日: 1.POJ 1847 Tram 题意:在一个交通网络上有N ...

  10. 图论刷水题记录(一)(最短路-----dijkstra算法)

    最近实在不知道干些什么,感觉自己除了水题什么都不会做,算了去刷一刷图论的水题吧本来想合起来一起发,想了想太长的话以后看起来也不方便,题目所以今天晚上就先发了dij部分,由上到下由易变难. 1.POJ ...

最新文章

  1. Linux下创建硬链接,文件访问为空,提示:xxxx: 符号连接的层数过多
  2. C++/STL Bitset (转)
  3. Office PPT如何切换到返回幻灯片
  4. USACO2.3【dfs,dp,背包】
  5. 二叉搜索树的操作题集
  6. echarts tooltips数据内容过多超出显示范围
  7. AUTOSAR E2E SecOC Comparison
  8. 培养学生计算机绘画水平,谈电脑绘画对高校绘画教学的作用
  9. Android5.1浏览器证书问题
  10. nvme固态硬盘开机慢_解决win10系统下nvme固体硬盘开机慢的方法
  11. 作业调度系统--SGE和PBS的使用方法
  12. UI设计:模仿淘宝App首页
  13. python如何连redis_Python连接Redis的基本配置方法
  14. 男程序员写代码的样子 VS 女程序员写代码的样子
  15. SpringCloud Admin监控界面解释
  16. 图解算法 使用Java
  17. Fidder使用工具介绍-1
  18. 专转本计算机必背知识点,江苏专转本计算机必考重点(精华版).doc
  19. PaddleOCR文字检测、标注与识别详细记录
  20. 空洞卷积dilated conv

热门文章

  1. hihocoder A Game 区间dp
  2. 计算机表格最高分,excel表格里怎样算最高分
  3. 第一批升级鸿蒙系统,鸿蒙系统公开了第一批升级名单,果粉认为不地道
  4. mysql binlog 备份_做好mysql运维,必须熟练掌握备份和恢复,实战一次不行多来几次...
  5. rs232串口驱动_电脑主板RS232串口硬件设计
  6. 语言求圆周率近似值改错_新证明解决了如何求无理数的近似值
  7. Spring 4 MVC 单元测试例子
  8. nlp 命名实体识别 算法_中文命名实体识别算法 Lattice LSTM
  9. html input p,我想在input.phtml中创建下拉框。 (不要使用zend_form)
  10. 详细解析Linux /etc/passwd文件