aboutsummaryrefslogtreecommitdiff
path: root/09_geometry/point_location_test_2189.cpp
diff options
context:
space:
mode:
Diffstat (limited to '09_geometry/point_location_test_2189.cpp')
-rw-r--r--09_geometry/point_location_test_2189.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/09_geometry/point_location_test_2189.cpp b/09_geometry/point_location_test_2189.cpp
new file mode 100644
index 0000000..998abb8
--- /dev/null
+++ b/09_geometry/point_location_test_2189.cpp
@@ -0,0 +1,21 @@
1#include <iostream>
2
3struct Point {
4 long long x;
5 long long y;
6 Point operator-(const Point& p) const { return Point{x-p.x, y-p.y}; }
7 long long operator*(const Point& v) { return x * v.y - y * v.x; }
8};
9
10int main() {
11 int t;
12 Point a, b, c;
13 std::cin >> t;
14 for (int i = 0; i < t; i++) {
15 std::cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
16 auto v = (b-a)*(c-a);
17 if (v > 0) std::cout << "LEFT\n";
18 else if (v < 0) std::cout << "RIGHT\n";
19 else std::cout << "TOUCH\n";
20 }
21}

Generated with cgit - Back to sebastiano.tronto.net