Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #define ULL unsigned long long
- #define LL long long
- #define uint unsigned int
- #define uchar unsigned char
- inline void thing(void) {
- LL x1, y1, x2, y2, x3, y3;
- scanf("%lld %lld %lld %lld %lld %lld", &x1, &y1, &x2, &y2, &x3, &y3);
- bool above, direction; // direction == true if right is above
- LL half1 = ((x3 - x1) * (y2 - y1)), half2 = ((y3 - y1) * (x2 - x1));
- if (half1 == half2) {
- printf("TOUCH\n");
- return;
- } else if (half1 > half2) {
- above = true;
- } else {
- above = false;
- }
- if (x1 > x2) {
- direction = true;
- } else {
- direction = false;
- }
- if (direction == above) {
- printf("RIGHT\n");
- } else {
- printf("LEFT\n");
- }
- return;
- }
- int main(void) {
- uint t;
- scanf("%u", &t);
- for (uint i = 0; i < t; i++) {
- thing();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement