#include #include using namespace std; vector> t; int ans = 1; long long int k, n, m; int main() { void counting(long long int, int); void specialcount(); int count=0; cin >> n >> k >> m; if (n == 1) { specialcount(); return 0; } if (n % 2 == 0) { for (; n % 2 == 0; n /= 2) { count++; } t.push_back(make_pair(2, k * count)); } for (long long int i = 3; n != 1; i += 2) { if (i > m) { t.push_back(make_pair(n,1)); break; } if (n % i == 0) { for (count = 0; n % i == 0; n /= i) { count++; } t.push_back(make_pair(i, k * count)); } } counting(0, 1); cout << ans; return 0; } void counting(long long int a, int px) { long long int x = px; if (a + 1 < size(t)) counting(a + 1, x); for (int i = 0; i < t[a].second; i++) { x *= t[a].first; if (x > m) { return; } else { ans++; if (a + 1 < size(t)) { counting(a + 1, x); } } } } void specialcount() { if (m == 0) cout << 0; else cout << 1; }