codeforces-scrape

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

515A.md (1857B)


      1 Source: https://codeforces.com/problemset/problem/515/A
      2 
      3 A. Drazil and Date
      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 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Someday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil's home is located in point (0, 0) and Varda's home is located in point (*a*, *b*). In each step, he can move in a unit distance in horizontal or vertical direction. In other words, from position (*x*, *y*) he can go to positions (*x* + 1, *y*), (*x* - 1, *y*), (*x*, *y* + 1) or (*x*, *y* - 1).
     22 
     23 Unfortunately, Drazil doesn't have sense of direction. So he randomly chooses the direction he will go to in each step. He may accidentally return back to his house during his travel. Drazil may even not notice that he has arrived to (*a*, *b*) and continue travelling.
     24 
     25 Luckily, Drazil arrived to the position (*a*, *b*) successfully. Drazil said to Varda: "It took me exactly *s* steps to travel from my house to yours". But Varda is confused about his words, she is not sure that it is possible to get from (0, 0) to (*a*, *b*) in exactly *s* steps. Can you find out if it is possible for Varda?
     26 
     27 Input
     28 
     29 You are given three integers *a*, *b*, and *s* ( - 109 ≤ *a*, *b* ≤ 109, 1 ≤ *s* ≤ 2·109) in a single line.
     30 
     31 Output
     32 
     33 If you think Drazil made a mistake and it is impossible to take exactly *s* steps and get from his home to Varda's home, print "No" (without quotes).
     34 
     35 Otherwise, print "Yes".
     36 
     37 Examples
     38 
     39 Input
     40 
     41 ```
     42 5 5 11
     43 ```
     44 
     45 Output
     46 
     47 ```
     48 No
     49 ```
     50 
     51 Input
     52 
     53 ```
     54 10 15 25
     55 ```
     56 
     57 Output
     58 
     59 ```
     60 Yes
     61 ```
     62 
     63 Input
     64 
     65 ```
     66 0 5 1
     67 ```
     68 
     69 Output
     70 
     71 ```
     72 No
     73 ```
     74 
     75 Input
     76 
     77 ```
     78 0 0 2
     79 ```
     80 
     81 Output
     82 
     83 ```
     84 Yes
     85 ```
     86 
     87 Note
     88 
     89 In fourth sample case one possible route is: ![](https://espresso.codeforces.com/0d30660ddf6eb6c64ffd071055a4e8ddd016cde5.png).