QOJ.ac

QOJ

时间限制: 3 s 内存限制: 2048 MB 总分: 100

#826. 使用原力吧,卢

统计

Steven 正在乘坐 Mellon-ian Tartan 号飞船进行绝地武士训练。他目前正在使用一个训练遥控器,该遥控器会向不同方向发射低功率激光,Steven 必须用他的光剑将其偏转。然而,原力在他身上并不强大,Steven 的表现并不理想。因此,他决定使用可编程机械臂来帮助他。他需要你为他的机械臂编写一个程序,以帮助他决定移动光剑的方向。

输入格式

输入包含一个整数 $n$($1 \le n \le 1000$),随后是 $n$ 行。每行包含六个整数,其绝对值均不超过 $1000$,顺序为 $x_1, y_1, x_2, y_2, x_3, y_3$。前四个数字代表光剑,即方程为 $(y - y_1) * (x_2 - x_1) = (x - x_1) * (y_2 - y_1)$ 的直线。(在本题中,光剑被视为向两个方向无限延伸的直线。)最后两个数字代表下一个激光点的位置 $(x_3, y_3)$。$(x_1, y_1)$ 和 $(x_2, y_2)$ 永远不会是同一个点。请仔细研究样例输入和输出,以确保你理解了题目。

输出格式

输出 $n$ 行。对于每一行,如果 $(x_3, y_3)$ 在直线的右侧,输出 “Right”;如果 $(x_3, y_3)$ 在直线的左侧,输出 “Left”;如果 $(x_3, y_3)$ 在直线上,输出 “Stay”。

样例

样例输入 1

5
0 1 1 3 2 5
0 1 1 3 -1 -1
0 0 1 1 5 0
1 1 0 0 5 0
0 0 0 1 3 4

样例输出 1

Stay
Stay
Right
Left
Right

说明

如果点的顺序不同,方程相同的直线可能“朝向不同”。例如,点 $(1,1)$ 在由 $(x_1, y_1) = (0, 0)$ 和 $(x_2, y_2) = (0, 1)$ 定义的直线的右侧,但在由 $(x_1, y_1) = (0, 1)$ 和 $(x_2, y_2) = (0, 0)$ 定义的直线的左侧。

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.