From 96254947699986c59f0dc63d69fd4b76bd3ed43e Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 6 Jul 2026 19:08:08 +0200 Subject: Initial commit --- 09_geometry/point_location_test_2189.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 09_geometry/point_location_test_2189.cpp (limited to '09_geometry/point_location_test_2189.cpp') 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 @@ +#include + +struct Point { + long long x; + long long y; + Point operator-(const Point& p) const { return Point{x-p.x, y-p.y}; } + long long operator*(const Point& v) { return x * v.y - y * v.x; } +}; + +int main() { + int t; + Point a, b, c; + std::cin >> t; + for (int i = 0; i < t; i++) { + std::cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y; + auto v = (b-a)*(c-a); + if (v > 0) std::cout << "LEFT\n"; + else if (v < 0) std::cout << "RIGHT\n"; + else std::cout << "TOUCH\n"; + } +} -- cgit v1.3