codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

18A.md (1585B)


      1 Source: https://codeforces.com/problemset/problem/18/A
      2 
      3 A. Triangle
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 64 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 At a geometry lesson Bob learnt that a triangle is called right-angled if it is nondegenerate and one of its angles is right. Bob decided to draw such a triangle immediately: on a sheet of paper he drew three points with integer coordinates, and joined them with segments of straight lines, then he showed the triangle to Peter. Peter said that Bob's triangle is not right-angled, but is almost right-angled: the triangle itself is not right-angled, but it is possible to move one of the points exactly by distance 1 so, that all the coordinates remain integer, and the triangle become right-angled. Bob asks you to help him and find out if Peter tricks him. By the given coordinates of the triangle you should find out if it is right-angled, almost right-angled, or neither of these.
     22 
     23 Input
     24 
     25 The first input line contains 6 space-separated integers *x*1, *y*1, *x*2, *y*2, *x*3, *y*3 — coordinates of the triangle's vertices. All the coordinates are integer and don't exceed 100 in absolute value. It's guaranteed that the triangle is nondegenerate, i.e. its total area is not zero.
     26 
     27 Output
     28 
     29 If the given triangle is right-angled, output RIGHT, if it is almost right-angled, output ALMOST, and if it is neither of these, output NEITHER.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 0 0 2 0 0 1
     37 ```
     38 
     39 Output
     40 
     41 ```
     42 RIGHT
     43 ```
     44 
     45 Input
     46 
     47 ```
     48 2 3 4 5 6 6
     49 ```
     50 
     51 Output
     52 
     53 ```
     54 NEITHER
     55 ```
     56 
     57 Input
     58 
     59 ```
     60 -1 0 2 0 0 1
     61 ```
     62 
     63 Output
     64 
     65 ```
     66 ALMOST
     67 ```