#include #include #include #include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int64_t N, K, M; vector> factors; set cand; vector> f(int64_t n) { vector> ret; for (int64_t i = 2; i * i <= n; i++) { int cnt = 0; while (n % i == 0) { n /= i; cnt += 1; } if (cnt > 0) { ret.emplace_back(i, cnt); } } if (n > 1) { ret.emplace_back(n, 1); } return ret; } void dfs(int i, int64_t val) { if (val > M or val < 0) return; cand.insert(val); if (i >= factors.size()) return; int64_t v, cnt; tie(v, cnt) = factors[i]; dfs(i + 1, val); int64_t p = v; rep(j, cnt) { if (val * p < 0 or val * p > M) break; dfs(i + 1, val * p); p *= v; if (p < 0 or p > M) break; } } int main() { cin >> N >> K >> M; factors = f(N); for (auto &p: factors) { p.second *= K; } dfs(0, 1); cout << cand.size() << endl; return 0; }