F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Different Division

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 408    Accepted Submission(s): 145


Problem Description
Now we will give you a graph, there are many points in the graph. We will choose two different points arbitrarily, and connect them as a line. Please tell us that whether these points (Include the two points referred above) is on the left side of the line, or lying on the line. or on the right side of the line. For example,

There are four points in the graph: A, B, C, D. we connect C and D. Now C and D form a new line ¡°CD¡±. Obviously, C and D are lying on the line ¡°CD¡±. A is on the right side of CD, and B is on the left side of CD. What¡¯s more, A is on the left side of line DC, and B is on the right side of line DC. So line ¡°CD¡± and ¡°DC¡± are different in this problem;
 

Input
The first line of input is a single integer T, indicating the number of test cases. Then exactly T test cases followed. In each case, the first line contains one integer: N, the number of points. Then N lines followed, each line contains two real numbers X, Y, indicating the coordinates of points. Then one line follows, contains two integers P1 and P2 indicate the P1th point and the P2th point in this case.
1<= T <= 100
2 <= N <= 1000
1<= P1, P2 <= N, P1 != P2
-1000 < X, Y < 1000;
 

Output
For each case, print N lines. According to the order of input, for each point print ¡°Left¡± if this point is on the left side of line P1P2 , or ¡±On¡± if this point is lying on line P1P2 , or ¡±Right¡± if this is on the right side of line P1P2.
 

Sample Input
1 4 1 1 1 2 3 3 2 1 1 3
 

Sample Output
On Left On Right
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-12 01:38:23, Gzip enabled