codeforces-scrape

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

683A.md (1240B)


      1 Source: https://codeforces.com/problemset/problem/683/A
      2 
      3 A. The Check of the Point
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 On the coordinate plane there is a square with sides parallel to the coordinate axes. The length of the square side is equal to *a*. The lower left corner of the square coincides with the point (0, 0) (the point of the origin). The upper right corner of the square has positive coordinates.
     22 
     23 You are given a point with coordinates (*x*, *y*). Your task is to determine whether this point is located strictly inside the square, on its side, or strictly outside the square.
     24 
     25 Input
     26 
     27 The first line contains three integers *a*, *x* and *y* (1 ≤ *a* ≤ 1000,  - 1000 ≤ *x*, *y* ≤ 1000) — the length of the square side and the coordinates of the point which should be checked.
     28 
     29 Output
     30 
     31 Print one integer:
     32 
     33 * 0, if the point is located strictly inside the square;
     34 * 1, if the point is located on the side of the square;
     35 * 2, if the point is located strictly outside the square.
     36 
     37 Examples
     38 
     39 Input
     40 
     41 ```
     42 2 1 1
     43 ```
     44 
     45 Output
     46 
     47 ```
     48 0
     49 ```
     50 
     51 Input
     52 
     53 ```
     54 4 4 4
     55 ```
     56 
     57 Output
     58 
     59 ```
     60 1
     61 ```
     62 
     63 Input
     64 
     65 ```
     66 10 5 -4
     67 ```
     68 
     69 Output
     70 
     71 ```
     72 2
     73 ```