#include #include #include using namespace std; using ll = long long; vector enum_divs (ll x) { vector res; for (int i = 1; i <= x; i++) { if (x < 1LL * i * i) break; if (x % i == 0) { res.push_back(i); if (x / i != i) res.push_back(x/i); } } sort(res.begin(), res.end()); return res; } int main () { ll N, K; cin >> N >> K; auto divs = enum_divs(N-K); int ans = 0; for (auto& v : divs) if (K < v) ans++; cout << ans << "\n"; }