CF227A.Where do I Turn?
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Trouble came from the overseas lands: a three-headed dragon Gorynych arrived. The dragon settled at point C and began to terrorize the residents of the surrounding villages.
A brave hero decided to put an end to the dragon. He moved from point A to fight with Gorynych. The hero rode from point A along a straight road and met point B on his way. The hero knows that in this land for every pair of roads it is true that they are either parallel to each other, or lie on a straight line, or are perpendicular to each other. He also knows well that points B and C are connected by a road. So the hero must either turn 90 degrees to the left or continue riding straight ahead or turn 90 degrees to the right. But he forgot where the point C is located.
Fortunately, a Brave Falcon flew right by. It can see all three points from the sky. The hero asked him what way to go to get to the dragon's lair.
If you have not got it, you are the falcon. Help the hero and tell him how to get him to point C: turn left, go straight or turn right.
At this moment the hero is believed to stand at point B, turning his back to point A.
麻烦来自海外:一条三头龙戈里尼奇降临了。这条龙盘踞在点 C,开始肆虐周边村庄的居民。
一位勇敢的英雄决定终结这条恶龙。他从点 A 出发前去讨伐戈里尼奇。英雄沿着一条笔直的道路从点 A 骑行,在途中经过了点 B。英雄知道,在这片土地上,任意两条道路之间要么互相平行,要么共线(即位于同一条直线上),要么互相垂直。他还清楚地知道,点 B 与点 C 之间有一条道路相连。因此,英雄在点 B 处必须作出如下选择之一:向左转 90∘、继续直行,或向右转 90∘。但他已忘记点 C 的具体方位。
幸运的是,一只勇敢的猎鹰恰好飞过。它能从空中俯瞰全部三个点。英雄便向它询问:该朝哪个方向走才能抵达恶龙的巢穴?
如果你尚未明白题意,那么你就是那只猎鹰。请帮助英雄,告诉他前往点 C 的正确方式:左转、直行,还是右转。
此时,英雄正站在点 B,面朝与点 A 相反的方向(即背对点 A)。
输入格式
The first input line contains two space-separated integers x__a, y__a (|x__a|, |y__a| ≤ 109) — the coordinates of point A. The second line contains the coordinates of point B in the same form, the third line contains the coordinates of point C.
It is guaranteed that all points are pairwise different. It is also guaranteed that either point B lies on segment AC, or angle ABC is right.
第一行输入包含两个以空格分隔的整数 xa, ya(满足 ∣xa∣, ∣ya∣≤109),表示点 A 的坐标。第二行以相同形式给出点 B 的坐标,第三行给出点 C 的坐标。
保证所有点两两互不相同。同时保证:要么点 B 位于线段 AC 上,要么 ∠ABC 是直角。
输出格式
Print a single line. If a hero must turn left, print "LEFT" (without the quotes); If he must go straight ahead, print "TOWARDS" (without the quotes); if he should turn right, print "RIGHT" (without the quotes).
输出一行。如果英雄必须向左转,则输出 LEFT(不带引号);如果他必须直行,则输出 TOWARDS(不带引号);如果他应该向右转,则输出 RIGHT(不带引号)。
输入输出样例
输入#1
0 0 0 1 1 1
输出#1
RIGHT
输入#2
-1 -1 -3 -3 -4 -4
输出#2
TOWARDS
输入#3
-4 -6 -3 -7 -2 -6
输出#3
LEFT
说明/提示
The picture to the first sample:

The red color shows points A, B and C. The blue arrow shows the hero's direction. The green color shows the hero's trajectory.
The picture to the second sample:

第一个样例的示意图:

红色表示点 A、B 和 C;蓝色箭头表示英雄的朝向;绿色表示英雄的运动轨迹。
第二个样例的示意图:

输入解题思路,AI测评打分。不知道怎么写?