Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main{
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int t;
- t = scan.nextInt();
- int x1,x2,x3,y1,y2,y3;
- while(t-- >0){
- x1 = scan.nextInt();
- y1 = scan.nextInt();
- x2 = scan.nextInt();
- y2 = scan.nextInt();
- x3 = scan.nextInt();
- y3 = scan.nextInt();
- int crossProduct=(x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
- if( crossProduct == 0)
- {
- System.out.println("Touch");
- }
- else if(crossProduct <0 )
- {
- System.out.println("RIGHT");
- }
- else {
- System.out.println("LEFT");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement