#include<stdio.h>
#include<math.h>
int main()
{
int x1,x2,y1,y2,x3,x4,y3,y4,h1,h2;
while(scanf("%d%d%d%d",&x1,&y1,&x2,&y2)!=EOF)
{
h1=x1-x2;h2=y1-y2;
h1=fabs(h1);
h2=fabs(h2);
if(h1!=0&&h2!=0&&h1!=h2)
{
printf("-1\n");
continue;
}
if(h1==0)
{
y3=y1;y4=y2;
x3=x1+h2;
x4=x2+h2;
}
if(h2==0)
{
x3=x1;x4=x2;
y3=y1+h1;
y4=y2+h1;
}
if(h1==h2)
{
x3=x1;x4=x2;
if(y1>y2)
{
y3=y1-h1;
y4=y2+h1;
}
else
{
y3=y1+h1;
y4=y2-h1;
}
}
printf("%d %d %d %d\n",x3,y3,x4,y4);
}
return 0;
}
Codeforces Round #261(Div.2) A. Pashmak and Garden
最新推荐文章于 2022-08-21 01:05:54 发布