Input
The first line of the input contains a single integer n (1 ≤ n ≤ 109) — Kolya's initial game-coin score.Output
Print "YES" (without quotes) if it's possible that Kolya spent all of his initial n coins buying only houses, cars and computers. Otherwise print "NO" (without quotes).Example Input
1359257 Output YES Input 17851817 Output NONote
In the first sample, one of the possible solutions is to buy one house, one car and one computer, spending 1 234 567 + 123 456 + 1234 = 1 359 257 game-coins in total. /*枚举 */ #include <stdio.h> #define num1 1234567 #define num2 123456 #define num3 1234 int main() { int a=1; long long int n; scanf("%lld",&n); for (int i=0;i<=811;i++)//811*1234567=1001233837 for (int j=0;j<=8011;j++)//8011*123456=989006016 { int m=n-(i*num1+j*num2); if(m<0)//当mx小于0的情况不用考虑 break; if(m%num3==0) { a=0; break; } } if(a==0) printf("YES"); else printf("NO"); return 0; }