#include #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair P; ll n,m; vector vec; vector cnts; int main(void){ scanf("%lld%lld",&n,&m); ll mp=m; for(ll i=2;i*i<=n;i++){ if(mp%i==0LL){ vec.push_back(i); cnts.push_back(0); while(mp%i==0LL){ cnts[cnts.size()-1]++; mp/=i; } } } if(mp!=1LL){ vec.push_back(mp); cnts.push_back(1); } ll cnt=0; ll np=n; int pp=1; for(int i=0;i