#include #include #include #include #include using namespace std; long N,K,M; mapcnt; long count2() { long L=0,R=1e9; while(R-L>1) { long mid=(L+R)/2; if(mid+K>N/mid)R=mid; else L=mid; } return L; } long A; bool isok(long T) { __int128 V=(__int128)K*K+4*T; __int128 L=0,R=1; while(R*R1) { long mid=(L+R)/2; if(mid*mid=A; } main() { cin>>N>>K>>M; A=1; for(;;A++) { if(A+K>N/A)break; long T=A; long U=A+K; int tm=0; while(U<=N/T) { T*=U; U+=K; cnt[T]++; tm++; } if(tm==1) { cnt[T]--; if(cnt[T]==0)cnt.erase(T); break; } } long one=count2()-A+1; long ans=0; for(pairp:cnt) { int now=p.second; if(isok(p.first)) { one--; now++; } if(now==M)ans++; } cout<