#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define INF (1 << 30) #define INFLL (1LL << 60) unsigned ll kai(unsigned ll num){ unsigned ll ans = num % 1000000000; for(unsigned ll i = ans - 1;i >= 1;i--){ ans %= 1000000000; ans *= i; } ans %= 1000000000; return ans; } unsigned ll mCn(unsigned ll m,unsigned ll n){ unsigned ll ans = kai(m) / (kai(m-n) * kai(n)); return ans ; } int main() { unsigned ll n,m,amari; cin >> n >> m; amari = n % (1000 * m); amari = amari / 1000 * 1000; amari /= 1000; if(amari == 0) cout << 1 << endl; else cout << mCn(m,amari) << endl; return 0; }