#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; const ll MOD=1e9+7; const int MAX = 2100000; ll fac[MAX], finv[MAX], inv[MAX]; ll b[MAX]; void init(){ fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i>n>>k>>m; ll ans=0; for(int i=1;i<=n;i++){ if(k%i==0) ans=(ans+(nCr(n-1,i-1)*modpow(n,n-i)%MOD)*b[i-1]%MOD)%MOD; } if(m==1) cout<