//g++ CF3.cpp -std=c++14 -O2 -I . #include using namespace std; using ll = long long; using ld = long double; using vi = vector; using vvi = vector; using vll = vector; using vvll = vector; using vld = vector; using vvld = vector; #define fi first #define se second #define pb push_back #define pq_big(T) priority_queue,less> #define pq_small(T) priority_queue,greater> #define all(a) a.begin(),a.end() #define rep(i,start,end) for(ll i=start;i<(ll)(end);i++) #define per(i,start,end) for(ll i=start;i>=(ll)(end);i--) //nを素因数分解 {素因数,個数} で管理 (1は空配列) vector> factor(ll n){ vector> res; int a=0; while(n%2==0){ n/=2; a++; } if(a>0){ res.pb({2,a}); } for(ll x=3;x*x<=n;x+=2){ if(n%x==0){ a=0; while(n%x==0){ n/=x; a++; } res.pb({x,a}); } } if(n>1){ res.pb({n,1}); } return res; } //nの約数配列(昇順) vector divisor(ll n){ auto fac=move(factor(n)); int sz=fac.size(); vector> x(sz); for(int i=0;i> res(sz); res[0]=x[0]; for(int i=1;i>n; if(n==1){ cout<<"2\n"; return; } auto x=divisor(n); auto p=factor(n); int z=x.size(); rep(i,2,100){ ll check=i*n; int check2=1; for(auto [value,cnt]:p){ int check3=0; while(check%value==0){ check/=value; check3++; } check2*=check3+1; } if(check>1){ check2*=2; } if(check2==z*2){ cout<>t; //t=1; while(t--){ solve(); } }