Advertisement
Guest User

Untitled

a guest
Nov 24th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main{
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. int t;
  7. t = scan.nextInt();
  8. int x1,x2,x3,y1,y2,y3;
  9. while(t-- >0){
  10. x1 = scan.nextInt();
  11. y1 = scan.nextInt();
  12. x2 = scan.nextInt();
  13. y2 = scan.nextInt();
  14. x3 = scan.nextInt();
  15. y3 = scan.nextInt();
  16. int crossProduct=(x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
  17. if( crossProduct == 0)
  18. {
  19. System.out.println("Touch");
  20. }
  21. else if(crossProduct <0 )
  22. {
  23. System.out.println("RIGHT");
  24. }
  25. else {
  26. System.out.println("LEFT");
  27. }
  28. }
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement