#ifdef SENJAN #define _GLIBCXX_DEBUG #else #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #endif #include #include #include using namespace std; using namespace atcoder; using ll=long long; using ull=unsigned long long; using ld=long double; using bint = boost::multiprecision::cpp_int; using graph=vector>; template using min_priority_queue=priority_queue,greater>; constexpr int INF32=INT_MAX/2; constexpr ll INF64=LLONG_MAX/2; constexpr ld PI=3.14159265358979323846; constexpr int dx[]={0,0,-1,1,-1,-1,1,1},dy[]={-1,1,0,0,-1,1,-1,1}; template inline bool chmax(T &a,T b){return a inline bool chmin(T &a,T b){return a>b?a=b,true:false;} inline void dispYN(bool a){cout<<(a?"YES":"NO")<sync_with_stdio(0);cout<> n >> k; ll m = n-k; set divs; for(ll d=1; d*d<=m; d++){ if(m%d==0){ divs.insert(d); divs.insert(m/d); } } ll ans = 0; for(ll d:divs){ if(k