#P7031. [NWRRC2016] Anniversary Cake

[NWRRC2016] 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