codeforces-scrape

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

606A.md (1560B)


      1 Source: https://codeforces.com/problemset/problem/606/A
      2 
      3 A. Magic Spheres
      4 
      5 time limit per test
      6 
      7 2 seconds
      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 Carl is a beginner magician. He has *a* blue, *b* violet and *c* orange magic spheres. In one move he can transform two spheres of the same color into one sphere of any other color. To make a spell that has never been seen before, he needs at least *x* blue, *y* violet and *z* orange spheres. Can he get them (possible, in multiple actions)?
     22 
     23 Input
     24 
     25 The first line of the input contains three integers *a*, *b* and *c* (0 ≤ *a*, *b*, *c* ≤ 1 000 000) — the number of blue, violet and orange spheres that are in the magician's disposal.
     26 
     27 The second line of the input contains three integers, *x*, *y* and *z* (0 ≤ *x*, *y*, *z* ≤ 1 000 000) — the number of blue, violet and orange spheres that he needs to get.
     28 
     29 Output
     30 
     31 If the wizard is able to obtain the required numbers of spheres, print "Yes". Otherwise, print "No".
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 4 4 0  
     39 2 1 2
     40 ```
     41 
     42 Output
     43 
     44 ```
     45 Yes
     46 ```
     47 
     48 Input
     49 
     50 ```
     51 5 6 1  
     52 2 7 2
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 No
     59 ```
     60 
     61 Input
     62 
     63 ```
     64 3 3 3  
     65 2 2 2
     66 ```
     67 
     68 Output
     69 
     70 ```
     71 Yes
     72 ```
     73 
     74 Note
     75 
     76 In the first sample the wizard has 4 blue and 4 violet spheres. In his first action he can turn two blue spheres into one violet one. After that he will have 2 blue and 5 violet spheres. Then he turns 4 violet spheres into 2 orange spheres and he ends up with 2 blue, 1 violet and 2 orange spheres, which is exactly what he needs.