#include #include #include using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 2000000000000000005 int main(){ long long L,R,M; cin>>L>>R>>M; if(M==1){ cout<<0< ps; { int m = M; for(int i=2;i<=M;i++){ if(m%i==0){ ps.push_back(i); while(m%i==0){ m /= i; } } } } vector v(M,1); vector> n(M,vector(ps.size(),0)); for(int i=1;i>n; long long ans = 0; for(long long i=1;i<=n-1;i++){ long long x = 1; for(long long j=1;j<=i;j++){ x *= (n-j+1) * (n-j+1); } for(long long k=i+1;k<=n;k++){ x *= k * k; } ans += x; } rep(i,n){ ans /= i+1; ans /= i+1; } cout<