QOJ.ac

QOJ

حد الوقت: 2.0 s حد الذاكرة: 256 MB مجموع النقاط: 100

#12724. 周年纪念蛋糕

الإحصائيات

两位学生 Adam 和 Anton 正在庆祝他们挂科数学逻辑考试两周年。在当地超市经过仔细挑选后,他们买了一个尺寸为整数的矩形蛋糕,以及两根蜡烛。

后来在校园里,Adam 将两根蜡烛放在了蛋糕上不同的整数坐标点上,并把刀交给 Anton 来切蛋糕。切痕的起点和终点必须位于蛋糕边缘的整数坐标点上,且切痕不能触碰到蜡烛。此外,切开后的每一块蛋糕上必须恰好有一根蜡烛。请帮助 Anton 找到切痕的起点和终点。

一个 $7 \times 3$ 的蛋糕,两根蜡烛分别位于 $(2, 2)$ 和 $(3, 2)$。Anton 可以沿着 $(0, 0)$ 到 $(4, 3)$ 的连线切开蛋糕。

输入格式

输入包含一行,包含六个整数:$w, h$ 表示蛋糕的尺寸;$a_x, a_y$ 表示第一根蜡烛的 $x$ 和 $y$ 坐标;$b_x, b_y$ 表示第二根蜡烛的坐标 ($3 \le w, h \le 10^9$; $0 < a_x, b_x < w$; $0 < a_y, b_y < h$; $a_x \neq b_x$ 或 $a_y \neq b_y$)。

输出格式

输出四个整数 $s_x, s_y, e_x, e_y$,分别表示切痕的起点和终点坐标。切痕的起点和终点都必须位于蛋糕的边缘上。

如果存在多种解,输出其中任意一个即可。

样例

样例输入 1

7 3 2 2 3 2

样例输出 1

0 0 4 3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.