计蒜客————Anniversary Cake

来源:互联网 发布:数码宝贝网络侦探进化 编辑:程序博客网 时间:2024/06/09 18:03
  •  21.08%
  •  2000ms
  •  262144K


Two students, Adam and Anton, are celebrating two-year anniversary of not passing their Math Logic exam. After very careful search in a local supermarket, they bought a rectangular cake with integer dimensions and two candles.

Later in the campus Adam put the candles into different integer points of the cake and gave a knife toAnton to cut the cake. The cut should start and end at integer points at the edges of the cake, and it should not touch the candles. Also each piece should have exactly one candle at it. Please, help Anton to find the starting and ending points of the cut.

image.png

Input

The single line of the input contains six integers: w,— cake dimensions; axa— andcoordinates of the first candle; bxb— the coordinates of the second candle (3 ≤ w,h ≤ 10^9109;0<ax, b<w;0<ay,b<h;a̸=bor a̸=by).

Output

Output four integers sxsyex, and e— the starting and ending coordinates of the cut. Both starting and ending point of the cut should belong to the sides of the cake.

If there are several solutions, output any of them. 


样例输入

7 3 2 2 3 2

样例输出

0 0 4 3
划水
#include<iostream>using namespace std;int main(){    int n,m,x1,x2,y1,y2;    while(cin>>n>>m>>x1>>y1>>x2>>y2){        if(x1==x2) cout<<"0 "<<y1<<' '<<n<<' '<<y2<<endl;        else cout<<x1<<" 0 "<<x2<<' '<<m<<endl;    }    return 0;}
原创粉丝点击