#include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i -1; j--) { a[j] *= b; if(a[j] >= NUM) { int tmp = a[j] / NUM; a[j+1] += tmp; a[j] -= tmp * NUM; } } } else { for(j = num-1; j > -1; j--) { a[j] /= b; if(a[j] % b) { a[j-1] += (a[j] % b) * NUM; } } } } void soroeru(ull a[],int num) { long i,j; for(j = 0; j < num; j++){ if(a[j] >= NUM) { int tmp = a[j] / NUM; a[j+1] += tmp; a[j] -= tmp * NUM; } } } void dekaiprint(ull a[],ull num) { long i,j; for(i=num-1;;i--) { if(a[i]) { printf("%llu",a[i]); break; } } i--; for(;i>-1;i--) printf("%09llu",a[i]); printf("\n"); } int main(void) { ull i,j; ull r; ull n,m; static ull com[10001] = {1,0}; cin >> n >> m; n /= 1000; r = n % m; n = m; for(i=0;i