#P7031. [NWRRC 2016] Anniversary Cake

[NWRRC 2016] Anniversary Cake

题目描述

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

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

A 7×37 \times 3 cake and two candles at (2,2)(2 , 2) and (3,2)(3 , 2) .

Anton can cut this cake through (0,0)(0 , 0) and (4,3)(4 , 3) .

输入格式

The single line of the input contains six integers: w,hw , h -- cake dimensions; ax,aya_{x}, a_{y} -- xx and y coordinatesy coordinates of the first candle; bx,byb_{x}, b_{y} -- the coordinates of the second candle (3w,h109; 0<ax,bx<w(3 \le w , h \le 10^{9}; 0 < a_{x}, b_{x} < w ; 0<ay,by<h0 < a_{y}, b_{y} < h ; ax  bxa_{x} ≠ b_{x} or ay by).a_{y }≠ b_{y}).

输出格式

Output four integers sx,sy,ex,s_{x}, s_{y}, e_{x}, and eye_{y} -- the starting and ending coordinates of the cut. Both starting andstarting 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

提示

Time limit: 2 s, Memory limit: 256 MB.

spj provider:

/user/137367