#pragma region KCLC // #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include using namespace std; #include #include using Bint = boost::multiprecision::cpp_int; using Real = boost::multiprecision::number>; using ll = long long; using ld = long double; using pii = pair; using pll = pair; #define pb push_back #define mp make_pair #define mt make_tuple #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define elif else if #define updiv(N, X) (N + X - 1) / X #ifdef LOCAL #include "debug.hpp" #else #define debug(...) #endif struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }; } fast_ios_; template inline bool chmax(T& a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T& a, T b) { return ((a > b) ? (a = b, true) : (false)); } struct UnionFind { vector par; UnionFind() {} UnionFind(int n) : par(n, -1) {} void init(int n) { par.assign(n, -1); } int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } int size(int x) { return -par[root(x)]; } vector> groups() { map> root_buf; for (int i = 0; i < par.size(); ++i) { int r = root(i); root_buf[r].push_back(i); } vector> res; for (const auto& i : root_buf) { res.push_back(i.second); } return res; } }; template struct Fp { long long val; constexpr Fp(long long v = 0) noexcept : val(v % MOD) { if (val < 0) val += MOD; } constexpr int getmod() const { return MOD; } constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; } constexpr Fp operator+(const Fp& r) const noexcept { return Fp(*this) += r; } constexpr Fp operator-(const Fp& r) const noexcept { return Fp(*this) -= r; } constexpr Fp operator*(const Fp& r) const noexcept { return Fp(*this) *= r; } constexpr Fp operator/(const Fp& r) const noexcept { return Fp(*this) /= r; } constexpr Fp& operator+=(const Fp& r) noexcept { val += r.val; if (val >= MOD) val -= MOD; return *this; } constexpr Fp& operator-=(const Fp& r) noexcept { val -= r.val; if (val < 0) val += MOD; return *this; } constexpr Fp& operator*=(const Fp& r) noexcept { val = val * r.val % MOD; return *this; } constexpr Fp& operator/=(const Fp& r) noexcept { long long a = r.val, b = MOD, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } val = val * u % MOD; if (val < 0) val += MOD; return *this; } constexpr bool operator==(const Fp& r) const noexcept { return this->val == r.val; } constexpr bool operator!=(const Fp& r) const noexcept { return this->val != r.val; } friend constexpr istream& operator>>(istream& is, Fp& x) noexcept { is >> x.val; x.val %= MOD; if (x.val < 0) x.val += MOD; return is; } friend constexpr ostream& operator<<(ostream& os, const Fp& x) noexcept { return os << x.val; } friend constexpr Fp modpow(const Fp& r, long long n) noexcept { if (n == 0) return 1; if (n < 0) return modpow(modinv(r), -n); auto t = modpow(r, n / 2); t = t * t; if (n & 1) t = t * r; return t; } friend constexpr Fp modinv(const Fp& r) noexcept { long long a = r.val, b = MOD, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } return Fp(u); } }; template struct BiCoef { vector fact_, inv_, finv_; constexpr BiCoef() {} constexpr BiCoef(int n) noexcept : fact_(n, 1), inv_(n, 1), finv_(n, 1) { init(n); } constexpr void init(int n) noexcept { fact_.assign(n, 1), inv_.assign(n, 1), finv_.assign(n, 1); int MOD = fact_[0].getmod(); for (int i = 2; i < n; i++) { fact_[i] = fact_[i - 1] * i; inv_[i] = -inv_[MOD % i] * (MOD / i); finv_[i] = finv_[i - 1] * inv_[i]; } } constexpr T com(int n, int k) const noexcept { if (n < k || n < 0 || k < 0) return 0; return fact_[n] * finv_[k] * finv_[n - k]; } constexpr T fact(int n) const noexcept { if (n < 0) return 0; return fact_[n]; } constexpr T inv(int n) const noexcept { if (n < 0) return 0; return inv_[n]; } constexpr T finv(int n) const noexcept { if (n < 0) return 0; return finv_[n]; } }; long long mypow(long long a, long long n) { long long res = 1; while (n > 0) { if (n & 1) res = res * a; a = a * a; n >>= 1; } return res; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } long double dis(pair a, pair b) { return sqrt(mypow(a.first - b.first, 2) + mypow(a.second - b.second, 2)); } #pragma endregion KCLC //---------------------------------------------------------------------------- const int inf = 1 << 30; const ll INF = 1LL << 60; const int dx[] = {1, 0, -1, 0, 1, -1, 1, -1}; const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1}; const int mod = 998244353; // const int mod = 1e9 + 7; using mint = Fp; BiCoef bc; struct Eratos { vector primes; vector isprime; vector mebius; vector min_factor; Eratos(int MAX) : primes(), isprime(MAX + 1, true), mebius(MAX + 1, 1), min_factor(MAX + 1, -1) { isprime[0] = isprime[1] = false; min_factor[0] = 0, min_factor[1] = 1; for (int i = 2; i <= MAX; ++i) { if (!isprime[i]) continue; primes.push_back(i); mebius[i] = -1; min_factor[i] = i; for (int j = i * 2; j <= MAX; j += i) { isprime[j] = false; if ((j / i) % i == 0) mebius[j] = 0; else mebius[j] = -mebius[j]; if (min_factor[j] == -1) min_factor[j] = i; } } } // 素因数分解 vector> prime_factors(int n) { vector> res; while (n != 1) { int prime = min_factor[n]; int exp = 0; while (min_factor[n] == prime) { ++exp; n /= prime; } res.push_back(make_pair(prime, exp)); } return res; } // 約数列挙 vector divisors(int n) { vector res({1}); auto pf = prime_factors(n); for (auto p : pf) { int siz = (int)res.size(); for (int i = 0; i < siz; ++i) { int v = 1; for (int j = 0; j < p.second; ++j) { v *= p.first; res.push_back(res[i] * v); } } } return res; } // 約数個数 int divisors_num(int n) { int res = 1; auto pf = prime_factors(n); for (auto p : pf) { res *= p.second + 1; } return res; } }; int main() { int X; cin>>X; Eratos era(X); map>m; for(int i=1;i