codeforces-scrape

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

633A.md (1432B)


      1 Source: https://codeforces.com/problemset/problem/633/A
      2 
      3 A. Ebony and Ivory
      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 Dante is engaged in a fight with "The Savior". Before he can fight it with his sword, he needs to break its shields. He has two guns, Ebony and Ivory, each of them is able to perform any non-negative number of shots.
     22 
     23 For every bullet that hits the shield, Ebony deals *a* units of damage while Ivory deals *b* units of damage. In order to break the shield Dante has to deal exactly *c* units of damage. Find out if this is possible.
     24 
     25 Input
     26 
     27 The first line of the input contains three integers *a*, *b*, *c* (1 ≤ *a*, *b* ≤ 100, 1 ≤ *c* ≤ 10 000) — the number of units of damage dealt by Ebony gun and Ivory gun, and the total number of damage required to break the shield, respectively.
     28 
     29 Output
     30 
     31 Print "Yes" (without quotes) if Dante can deal exactly *c* damage to the shield and "No" (without quotes) otherwise.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 4 6 15
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 No
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 3 2 7
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 Yes
     57 ```
     58 
     59 Input
     60 
     61 ```
     62 6 11 6
     63 ```
     64 
     65 Output
     66 
     67 ```
     68 Yes
     69 ```
     70 
     71 Note
     72 
     73 In the second sample, Dante can fire 1 bullet from Ebony and 2 from Ivory to deal exactly 1·3 + 2·2 = 7 damage. In the third sample, Dante can fire 1 bullet from ebony and no bullets from ivory to do 1·6 + 0·11 = 6 damage.