Malinovsky239

Untitled

Sep 25th, 2012
870
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <cstring>
  5. #include <cassert>
  6. #include <complex>
  7. #include <cstdio>
  8. #include <vector>
  9. #include <cctype>
  10. #include <string>
  11. #include <ctime>
  12. #include <cmath>
  13. #include <set>
  14. #include <map>
  15.  
  16. typedef long double LD;
  17. typedef long long LL;
  18.  
  19. using namespace std;
  20.  
  21. #define sz(A) (int)(A).size()
  22. #define mp make_pair
  23. #define pb push_back
  24.  
  25. struct vect {
  26.     int x, y;
  27.  
  28.     vect() {}
  29.  
  30.     vect(int a, int b) {
  31.         x = a, y = b;
  32.     }
  33.  
  34.     void read() {
  35.         cin >> x >> y;
  36.     }
  37. };
  38.  
  39. vect operator - (vect a, vect b) {
  40.     return vect(a.x - b.x, a.y - b.y);
  41. }
  42.  
  43. LL operator % (vect a, vect b) {
  44.     return LL(a.x) * b.y - LL(a.y) * b.x;
  45. }
  46.  
  47. int main() {
  48.     vect a, b, c;
  49.     a.read();
  50.     b.read();
  51.     c.read();
  52.  
  53.     vect ab = b - a, bc = c - b;
  54.  
  55.     if (ab % bc == 0) {
  56.         puts("TOWARDS");
  57.     }  
  58.     else {
  59.         if (ab % bc > 0) {
  60.             puts("LEFT");
  61.         }
  62.         else {
  63.             puts("RIGHT");
  64.         }
  65.     }
  66.        
  67.     return 0;
  68. }
RAW Paste Data