#include #include #include #include typedef long long ll; typedef std::pair P; const ll MOD = 100000009ll; int main(){ int Q; scanf("%d", &Q); for(int _=0;_ v(N+1); v[0] = seed; for(int i=1;i<=N;i++){ v[i] = 1 + (v[i-1]*v[i-1]%MOD + v[i-1]*12345%MOD) % MOD; } std::vector

fs; for(int i=2;i*i<=B;i++){ if(B % i == 0){ int t = 0; while(B % i == 0){t += 1; B /= i;} fs.push_back(std::make_pair(i, t)); } } if(B > 1){fs.push_back(std::make_pair(B, 1));} // for(auto f : fs){ // printf("%d %d\n", f.first, f.second); // } std::vector v2(N+1); int res = 1001001001; for(auto f : fs){ int p = f.first, q = f.second; for(int i=0;i