122A.md (1106B)
1 Source: https://codeforces.com/problemset/problem/122/A 2 3 A. Lucky Division 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 stdin 16 17 output 18 19 stdout 20 21 Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. 22 23 Petya calls a number almost lucky if it could be evenly divided by some lucky number. Help him find out if the given number *n* is almost lucky. 24 25 Input 26 27 The single line contains an integer *n* (1 ≤ *n* ≤ 1000) — the number that needs to be checked. 28 29 Output 30 31 In the only line print "YES" (without the quotes), if number *n* is almost lucky. Otherwise, print "NO" (without the quotes). 32 33 Examples 34 35 Input 36 37 ``` 38 47 39 ``` 40 41 Output 42 43 ``` 44 YES 45 ``` 46 47 Input 48 49 ``` 50 16 51 ``` 52 53 Output 54 55 ``` 56 YES 57 ``` 58 59 Input 60 61 ``` 62 78 63 ``` 64 65 Output 66 67 ``` 68 NO 69 ``` 70 71 Note 72 73 Note that all lucky numbers are almost lucky as any number is evenly divisible by itself. 74 75 In the first sample 47 is a lucky number. In the second sample 16 is divisible by 4.