QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 2048 MB 満点: 100

#15919. 只见树木,不见森林

統計

你正在和 Belle 在森林里玩捉迷藏。森林中每个正整数格点上都有一棵树。也就是说,在每个点 $(x, y)$(其中 $x$ 和 $y$ 均为正整数)上都有一棵树。你可以将每棵树视为一个点。一家伐木公司砍倒了某个轴对齐矩形内的所有树木,包括矩形边界上的树木。

你站在 $(0, 0)$,Belle 站在 $(x_b, y_b)$。当且仅当没有树木阻挡你到 Belle 的视线时,你才能看到 Belle。如果 $(x_b, y_b)$ 处有一棵树,Belle 会站在该树朝向你位置的一侧,以便你更容易找到她。

例如,假设 Belle 站在 $(2, 6)$。如果以 $(1, 1)$ 和 $(5, 4)$ 为顶点的矩形内的树木被砍倒(图中蓝色矩形),那么你就能看到 Belle。然而,如果矩形位于 $(3, 5)$ 和 $(5, 7)$(图中红色矩形),那么位于 $(1, 3)$ 的树就会挡住视线。

给定矩形和 Belle 的位置,你能看到她吗?

输入格式

输入的第一行包含两个整数 $x_b$ 和 $y_b$($1 \le x_b, y_b \le 10^{12}$),表示 Belle 站立位置的坐标。

第二行包含四个整数 $x_1$、$y_1$、$x_2$ 和 $y_2$($1 \le x_1 \le x_2 \le 10^{12}$ 且 $1 \le y_1 \le y_2 \le 10^{12}$),指定矩形的两个对角顶点 $(x_1, y_1)$ 和 $(x_2, y_2)$。

输出格式

如果你能看到 Belle,输出 Yes

否则,输出 No,并在下一行输出阻挡你视线的最近一棵树的坐标。

样例

输入样例 1

2 6
1 1 5 4

输出样例 1

Yes

输入样例 2

2 6
3 5 5 7

输出样例 2

No
1 3

输入样例 3

830844890448 39710592053
821266 42860 402207107926 423171345006

输出样例 3

No
402207964848 19223704203

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.