QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB 總分: 100

#15125. 订书机

统计

爱丽丝(Alice)正在玩具店销售一款新版游戏机。在售出新游戏机时,爱丽丝会使用订书机将收据固定在包装盒上。

然而,订书机会在包装盒上钉入两个点,从而对这两个点之间的整个线段区域造成穿透。如果该线段的任何部分(包括其端点)与游戏机的屏幕(包括其边界)重叠,屏幕就会受损,爱丽丝必须为此赔偿游戏机。

幸运的是,激光显示了包装盒内屏幕的精确位置。游戏机的屏幕是一个边平行于坐标轴的矩形。其左下角坐标为 $(x_l, y_l)$,右上角坐标为 $(x_r, y_r)$。

爱丽丝计划在点 $(x_1, y_1)$ 和 $(x_2, y_2)$ 处钉下订书针。请帮助她判断订书机是否会损坏屏幕。如果会,请立即阻止她。

输入格式

每个测试文件包含多个测试用例。第一行包含测试用例的数量 $t$。接下来是测试用例的描述。

每个测试用例的第一行包含四个整数 $x_l, y_l, x_r, y_r$,表示屏幕左下角和右上角的坐标。

每个测试用例的第二行包含四个整数 $x_1, y_1, x_2, y_2$,表示预期的订书针穿透位置的坐标。

输出格式

对于每个测试用例,如果爱丽丝会损坏屏幕,则在一行中输出 STOP,否则输出 OK

数据范围

  • $1 \le t \le 10^4$
  • 屏幕的面积大于 $0$。
  • 订书针的长度大于 $0$。
  • 所有坐标均为整数,且绝对值最大为 $10^4$。

样例

输入样例 1

3
0 0 5 5
0 10 10 0
0 0 5 5
6 6 6 7
0 0 5 5
1 1 2 2

输出样例 1

STOP
OK
STOP

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.