#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) template bool chmin(T &x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T &x, T y) { return x < y ? (x = y, true) : false; } struct io_setup { io_setup() { ios::sync_with_stdio(false); std::cin.tie(nullptr); cout << fixed << setprecision(15); } } io_setup; const int sz=2e5+10; vector pdv(sz,-1); void init(){ rep(i,2,sz){ if(pdv.at(i)!=-1) continue; for(int j=i;j fac(MAX_N+1,1); vector finv(MAX_N+1,1); vector inv(MAX_N+1,1); void comb_setup(){ for(int i=2;i<=MAX_N;i++){ fac.at(i)=(fac.at(i-1)*i)%MOD; inv.at(i)=MOD-(inv.at(MOD%i)*(MOD/i))%MOD; finv.at(i)=(finv.at(i-1)*inv.at(i))%MOD; } } ll comb(int n,int k){ if(n>q; ll dd=0; auto dvmul=[&](int x){ while(x>1){ dd++; x/=pdv.at(x); } }; auto calc=[&](int n){ return comb(dd-1,n-1); }; rep(i,0,q){ int a,b; cin>>a>>b; dvmul(a); cout<