10250 - The Other Two Trees

Problem E

The Other Two Trees

Input: standard input

Output: standard output

Time Limit: 2 seconds

 

You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, that means you have a common fence with all of them. For example if you have a fence of length d in one side, this fence of length d is also the fence of the adjacent neighbor on that side. The adjacent neighbors have no fence in common among themselves and their lands also don’t intersect. The main difference between their land and your land is that their lands are all square shaped. All your neighbors have a tree at the center of their lands. Given the Cartesian coordinates of trees of two opposite neighbors, you will have to find the Cartesian coordinates of the other two trees.

 

Input

The input file contains several lines of input. Each line contains four floating point or integer numbers x1, y1, x2, y2, where (x1, y1), (x2, y2) are the coordinates of the trees of two opposite neighbors. Input is terminated by end of file.

 

Output

For each line of input produce one line of output which contains the line “Impossible.” without the quotes, if you cannot determine the coordinates of the other two trees. Otherwise, print four floating point numbers separated by a single space with ten digits after the decimal pointax1, ay1, ax2, ay2, where (ax1, ay1)  and (ax2, ay2) are the coordinates of the other two trees. The output will be checked with special judge program, so don’t worry about the ordering of the points or small precision errors. The sample output will make it clear.

 

Sample Input

10 0 -10 0

10 0 -10 0

10 0 -10 0

 

Sample Output

0.0000000000 10.0000000000 0.0000000000 -10.0000000000

0.0000000000 10.0000000000 -0.0000000000 -10.0000000000

0.0000000000 -10.0000000000 0.0000000000 10.0000000000


一个四边形,然后以每个边向外做四个正方形。四棵树,每棵种在正方形的中心,告诉你相对的两棵的坐标,求另外两棵的坐标。

其实就是很水的几何题,自己画一下图就晓得啦。

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main ()
{
    double x1,y1,x2,y2,ax1,ay1,bx2,by2,a,b,x,y;
    while(cin>>x1>>y1>>x2>>y2)
    {
        if (x1==x2 && y1==y2) printf("Impossible.\n");
        else
        {
            x=(x1+x2)/2;
            y=(y1+y2)/2;
            ax1=x+(y1-y);
            bx2=x-(y1-y);
            ay1=y-(x1-x);
            by2=y+(x1-x);
            printf("%.10lf %.10lf %.10lf %.10lf\n",ax1,ay1,bx2,by2);
        }
    }
    return 0;
}


Dr. Other之间为什么只能形成two-way的原因有很多。以下是可能的解释: 首先,Dr. Other之间的交流需要双方的配合和参与。在形成two-way的关系中,双方都要积极表达自己的意见、目标和需求。如果其中一方不愿意或不能参与,那么两人之间的对话就无法进行。 其次,Dr. Other之间的沟通需要双方的互动和反馈。只有在有人听取、理解并回应对方的观点、问题和感受的情况下,才能形成真正的互动和对话。如果只有单向的信息流动,只有一方在发声而另一方不做出反应,那么两人之间的交流就无法达到深入和有效的程度。 再次,Dr. Other之间的关系需要建立在相互理解和共同利益的基础之上。只有双方能够理解对方的立场和利益,并试图寻求共同点和解决问题的方法,才能真正实现双向的交流和合作。如果任何一方只关注自身利益,而不愿意倾听和尊重对方的意见,那么双方之间的交流就会受阻。 最后,Dr. Other之间形成two-way的关系需要时间和精力的投入。双方需要互相倾听、理解和回应,这需要付出一定的心理和情感上的努力。如果双方都不愿意或无法投入足够的时间和精力来维持双向的交流,那么关系就只能停留在单向的形式上。 综上所述,Dr. Other之间只能形成two-way的交流关系,是由于配合与参与、互动与反馈、相互理解与共同利益、时间与精力的因素共同作用的结果。它需要双方的积极参与和努力,才能达到有效的沟通和互动效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值