#L7031. [NWRRC 2016] Anniversary Cake
[NWRRC 2016] Anniversary Cake
Problem Description
题目描述
Two students, Adam and Anton, are celebrating their two-year anniversary. After searching a local supermarket, they bought a rectangular cake with integer dimensions and two candles.
Adam placed the candles at two distinct integer points inside the cake and gave Anton a knife. The cut must start and end at integer points on the cake boundary, must not touch either candle, and must leave exactly one candle on each side. Help Anton find such a cut.
A 7 × 3 cake with candles at (2, 2) and (3, 2) can be cut through (0, 0) and (4, 3).
输入格式
The input contains six integers: w, h, a_x, a_y, b_x, b_y — the cake dimensions and candle coordinates. The constraints are 3 ≤ w, h ≤ 10^9, 0 < a_x, b_x < w, 0 < a_y, b_y < h, and the candle points are distinct.
输出格式
Output four integers s_x, s_y, e_x, and e_y, the endpoints of the cut. Both endpoints must lie on the cake boundary. If there are several solutions, output any of them.
样例
样例 1
7 3 2 2 3 2
0 0 4 3