#include #include using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i < n; i++) #define all(a) a.begin(),a.end() #define SORT(a) sort(all(a)); #define MIN(a) *min_element(all(a)) #define MAX(a) *max_element(all(a)) #define SUM(a) accumulate(all(a),0LL) using ll=long long; using ld=long double; using ull=unsigned long; ll MOD=998244353; using mint = static_modint<998244353>; const int dx[]={0,1,0,-1,1,-1,1,-1};const int dy[]={1,0,-1,0,1,1,-1,-1}; const string ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZ";const string alpha="abcdefghijklmnopqrstuvwxyz"; long long partition(int n) { vector p(n + 1, 0); p[0] = 1LL; // 空の和の方法が1つ(何も選ばない) for (int k = 1; k <= n; ++k) { for (int i = k; i <= n; ++i) { p[i] += p[i - k]; } } return p[n]; } vector sieve(int n) { vector is_prime(n + 1, true); vector primes; is_prime[0] = is_prime[1] = false; // 0と1は素数ではない for (int i = 2; i <= n; ++i) { if (is_prime[i]) { primes.push_back(i); for (long long j = 1LL * i * i; j <= n; j += i) { is_prime[j] = false; } } } return primes; } // 素因数分解を行う関数 vector> prime_factors(long long n) { vector> factors; vector primes = sieve(static_cast(sqrt(n)) + 1); // nの平方根までの素数を列挙 for (int p : primes) { if (1LL * p * p > n) break; // pがnの平方根以上になったら終了 if (n % p == 0) { int count = 0; while (n % p == 0) { n /= p; count++; } factors.push_back({p, count}); } } if (n > 1) { factors.push_back({n, 1}); // nが素数の場合 } return factors; } int main(){ cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); ll n;cin>>n; int ans=1; vector> factors = prime_factors(n); for(ll i=0;i