2900: F-A Simple Question

时间限制: 1 Sec  内存限制: 128 MB

提交: 66  解决: 24

题目描述

今天,pasher打算在一个浪漫的花园和他的搭档们聚餐,但是不幸的是,pasher忘记了花园的地点,他只记得这个花园看上去像个平行于坐标轴的正方形,他还记得花园的每个顶点上都有一棵大数。现在,pasher知道其中两棵树的坐标,且这两棵树在对角线上,你能帮他找出另外两棵树的坐标吗?

输入

多组输入,直到文件末。每组输入包含一行,第一行包含四个整数,x1,y1,x2,y2,代表pasher知道的两棵树的坐标,(-100<=x1,y1,x2,y2<=100),其中x1,y1代表第一棵树,x2,y2代表第二棵树。

输出

如果没有解则输出-1。否则输出另外两棵树的坐标x3,y3,x4,y4,按x递增的顺序输出.

样例输入

0 0 1 1

样例输出

0 1 1 0
im0qianqian_站在回忆的河边看着摇晃的渡船终年无声地摆渡,它们就这样安静地画下黄昏画下清晨......

#include <stdio.h>
#include <stdlib.h>
int main()
{
int x1,y1,x2,y2,x3,y3,x4,y4;
while (~scanf("%d%d%d%d",&x1,&y1,&x2,&y2))
{
if ((x1!=x2)&&(y1!=y2)&&abs(x1-x2)==abs(y1-y2))
{
if (x1<x2)x3=x1,x4=x2,y3=y2,y4=y1;
else x3=x2,x4=x1,y3=y1,y4=y2;
printf("%d %d %d %d\n",x3,y3,x4,y4);
}
else printf("-1\n");
}
return 0;
}

YTU 2900: F-A Simple Question的更多相关文章

  1. zoj 1763 A Simple Question of Chemistry

    A Simple Question of Chemistry Time Limit: 2 Seconds      Memory Limit: 65536 KB Your chemistry lab ...

  2. 2016HUAS暑假集训训练2 F - A Simple Problem with Integers

    Description 给出了一个序列,你需要处理如下两种询问. "C a b c"表示给[a, b]区间中的值全部增加c (-10000 ≤ c ≤ 10000). " ...

  3. 2014 Super Training #9 F A Simple Tree Problem --DFS+线段树

    原题: ZOJ 3686 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3686 这题本来是一个比较水的线段树,结果一个ma ...

  4. Simple Question

    一.你会在时间序列数据集上使用什么交叉验证技术?是用k倍? 答:都不是.对于时间序列问题,k倍可能会很麻烦,因为第4年或第5年的一些模式有可能跟第3年的不同,而我们最终可能只是需要对过去几年的进行验证 ...

  5. A Simple Question of Chemistry

    #include<stdio.h> int main() { int i, l; ]; ]; l = ; ) { l++; } ; a[i]!= && i<l; i+ ...

  6. K Simple question (第十届山东理工大学ACM网络编程擂台赛 正式赛)

    题解:素数筛+唯一分解定理 可以把素数筛那部分放到while之外,减小时间复杂度. #include <stdio.h> #include <stdlib.h> #includ ...

  7. A Simple Problem with Integers(线段树)

    F - A Simple Problem with Integers Time Limit:5000MS     Memory Limit:131072KB     64bit IO Format:% ...

  8. Functional Programming without Lambda - Part 1 Functional Composition

    Functions in Java Prior to the introduction of Lambda Expressions feature in version 8, Java had lon ...

  9. HDU 4343 贪心

    D - Interval queryTime Limit: 1.5 Sec Memory Limit: 256 MB Description This is a very simple questio ...

随机推荐

  1. 【05】Firebug动态执行JavaScript

    Firebug动态执行JavaScript 您可以使用Firebug来编写并实时执行一个JavaScript. 这是为了测试,并确保该脚本工作正常,这是将JavaScript代码部署在生产环境前的好方 ...

  2. xtu summer individual 4 C - Dancing Lessons

    Dancing Lessons Time Limit: 5000ms Memory Limit: 262144KB This problem will be judged on CodeForces. ...

  3. C#通信学习(一)

    基础知识 TCP/IP:Transmission Control Protocol/Internet Protocol,传输控制协议/因特网互联协议,又名网络通讯协议.简单来说:TCP控制传输数据,负 ...

  4. Can you answer these queries(spoj 1043)

    题意:多次查询区间最长连续字段和 /* 用线段树维护区间最长子段和,最长左子段和,最长右子段和. */ #include<cstdio> #include<iostream> ...

  5. [NOIP2000] 提高组 洛谷P1018 乘积最大

    题目描述 今年是国际数学联盟确定的“2000――世界数学年”,又恰逢我国著名数学家华罗庚先生诞辰90周年.在华罗庚先生的家乡江苏金坛,组织了一场别开生面的数学智力竞赛的活动,你的一个好朋友XZ也有幸得 ...

  6. js闭包的用途[转载]

    通过使用闭包,我们可以做很多事情.比如模拟面向对象的代码风格:更优雅,更简洁的表达出代码:在某些方面提升代码的执行效率. 1 匿名自执行函数我们知道所有的变量,如果不加上var关键字,则默认的会添加到 ...

  7. sgu179 SGU起航!

    //发现dfs除了搜索功能外的其他功能,他本身是一种序列,这个题恰是"先序"的下一个(合法范围内)序列! #include<iostream> #include< ...

  8. python之-- 异常

    异常处理: 语法:try: codeexcept (KeyError..可以写多个) as e: error为抓取的多个错误提示,e为错误信息 print(e) # 打印错误信息except (Ind ...

  9. uva 11691

    贪心 ~~ 使用优先队列 #include <cstdio> #include <cstdlib> #include <cmath> #include <se ...

  10. SpringMVC get请求中文乱码

    针对GET请求的编码问题,则需要改tomcat的server.xml配置文件,如下: 原 <Connector connectionTimeout="20000" port= ...