Language: C++

// #include <bits/stdc++.h>
#include <iostream>  // cin, cout, string
#include <algorithm> // sort, min/max, upper/lower_bound, transform, count/copy_if
#include <vector>
#include <utility> // pair, swap
#include <functional>
#include <iomanip> // setprecision
#include <map>
#include <set> // multiset
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <stack>
#include <queue> // priority_queue
#include <deque>
#include <bitset>
#include <array>
#include <list>
#include <forward_list>
#include <complex>
#include <ratio>
#include <cassert>
#include <numeric> // accumulate, itoa
#include <random>  // mt19937
#include <iterator>
#include <chrono>
#include <cstring>

using namespace std;

// #define int long long

using i64 = int64_t;
using ll = long long;
using ld = long double;

template <typename T>
using vec = vector<T>;
template <typename T>
using mat = vec<vec<T>>;
template <typename T>
using dic = unordered_map<string, T>;
template <typename T>
using pqg = priority_queue<T, vector<T>, greater<T>>; // dijkstra
// template<typename T, typename U> using P = pair<T, U>;
// template<typename... Args> using func = function<Args...>;
// template<typename T> using pq = priority_queue<T>;

using pii = pair<int, int>;
using ppi = pair<pii, int>;
using pip = pair<int, pii>;
using ppp = pair<pii, pii>;

using vi = vec<int>;
using mi = mat<int>; // Graph
using vp = vec<pii>;

constexpr int IINF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
// constexpr int INF = sizeof(int) == sizeof(long long) ? LINF : IINF;
constexpr long long MOD = 1e9 + 7;

#define _overload(_1, _2, _3, name, ...) name
#define _rep1(i, a, b) for (int i = (a), _##i = (b); i < _##i; ++i)
#define _rep2(i, n) _rep1(i, 0, n)
#define _rep3(n) _rep2(i, n)
#define rep(...) _overload(__VA_ARGS__, _rep1, _rep2, _rep3)(__VA_ARGS__)
#define _rrep1(i, a, b) for (int i = (b)-1, _##i = (a); i >= _##i; --i)
#define _rrep2(i, n) _rrep1(i, 0, n)
#define _rrep3(n) _rrep2(i, n)
#define rrep(...) _overload(__VA_ARGS__, _rrep1, _rrep2, _rrep3)(__VA_ARGS__)

#define each(i, a) for (auto &&i : a)
#define each2(i, a) for (const auto &i : a)

#define pb push_back
// emplace_back(*) == push_back(constructor(*))
#define eb emplace_back
#define pob pop_back
#define pf push_front
#define pof pop_front

#define np next_permutation
#define pp prev_permutation

// make_pair(A, B) == pair<T, U>(A, B)
#define mp make_pair
// mt(...) == tie(...)
#define mt make_tuple

#define ft first
#define sd second

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)(a).size()
#define rev(a) reverse(all(a))
#define rs(a, l) (a).resize(l)

#define upper(s) transform(all(s), (s).begin(), topper)
#define lower(s) transform(all(s), (s).begin(), tolower)

#define sum(a) accumulate(all(a), 0)
#define elif else if
#define unless(a) if (!(a))
#define qt(a) #a

#define endl '\n'
#define dec(n) fixed << setprecision(n)
#define zfl(n) setfill(‘0’) << setw(n)

template <typename T = int, T l = 0, T r = (T)MOD>
auto rnd = bind(uniform_int_distribution<T>(l, r), mt19937(chrono::steady_clock::now().time_since_epoch().count()));

template <typename T>
inline constexpr T gcd(T a, T b)
{
    if (a == 0 || b == 0)
        return 0;
    while (b)
    {
        a = a % b;
        swap(a, b);
    }
    return a;
}
template <typename T>
inline constexpr T extgcd2(T a, T b, T &x, T &y)
{
    x = 1;
    y = 0;
    while (b)
    {
        T t = a / b;
        a -= t * b;
        swap(a, b);
        x -= t * y;
        swap(x, y);
    }
    return a;
}
template <typename T>
inline constexpr T lcm(T a, T b) { return a / gcd(a, b) * b; }

template <typename T>
inline constexpr bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <typename T>
inline constexpr bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename A, typename B>
istream &operator>>(istream &is, pair<A, B> &p)
{
    is >> p.first;
    is >> p.second;
    return is;
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p)
{
    os << p.first << " " << p.second;
    return os;
}

template <typename T>
istream &operator>>(istream &is, vector<T> &v)
{
    for (auto &&x : v)
        is >> x;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    for (int i = 0; i < (int)v.size(); ++i)
        cout << v[i] << (i + 1 != (int)v.size() ? " " : "");
    return os;
}

#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg>
void __f(const char *name, const Arg &arg)
{
    cerr << name << " : " << arg << endl;
}
template <typename Arg, typename... Args>
void __f(const char *names, const Arg &arg, const Args &... args)
{
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg << " | ";
    __f(comma + 1, args...);
}

inline auto yes(const bool &c) { return c ? "yes" : "no"; }
inline auto Yes(const bool &c) { return c ? "Yes" : "No"; }
inline auto YES(const bool &c) { return c ? "YES" : "NO"; }
inline auto Possible(const bool &c) { return c ? "Possible" : "Impossible"; }
inline auto POSSIBLE(const bool &c) { return c ? "POSSIBLE" : "IMPOSSIBLE"; }

constexpr int lim = 100007; // 10^5+7

int n;

int L[78500];
ll p[78500];
vec<ll> a;

constexpr ll a_max = 1000010;
ll inv[a_max];
bool check[a_max];
void setPrime()
{
    bool f;
    int c = 1;
    p[0] = 2;
    rep(i, 3, a_max)
    {
        f = true;
        for (int j = 0; j < c; j++)
        {
            ll pr = p[j];
            // cout << pr << " " << j << " " << i << " " << c << endl;
            if (i % pr == 0)
            {
                f = false;
                break;
            }
            if (pr * pr > i)
            {
                break;
            }
        }

        if (f)
        {
            p[c] = i;

            c += 1;
        }
    }
}

ll mod_inv(ll a)
{
    if (inv[a] > 0)
        return inv[a];
    ll b = MOD, u = 1, v = 0, _a = a;
    while (b)
    {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= MOD;
    if (u < 0)
        u += MOD;
    inv[_a] = u;
    return u;
}

ll mod_pow(ll a, ll n)
{
    ll res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

signed main()
{
    // cin.tie(0);
    // cout.tie(0);
    // ios_base::sync_with_stdio(false);
    setPrime();
    // rep(p.size()) cout << p.at(i) << " ";
    cin >> n;
    ll ans = 0;
    int e, pr;
    rep(78500) L[i] = 0;
    rep(a_max)
    {
        inv[i] = -1;
        check[i] = false;
    }
    a.resize(n);
    rep(n) cin >> a.at(i);
    rep(n)
    {
        ans = (ans + mod_inv(a.at(i))) % MOD;
        // cout << mod_inv(a) << endl;
        if (!check[a.at(i)])
        {
            check[a.at(i)] = true;
            rep(78498)
            {
                e = 0;
                pr = p[i];
                while (a.at(i) % pr == 0)
                {
                    e++;
                    a.at(i) /= pr;
                }
                if (L[i] < e)
                    L[i] = e;
                if (a.at(i) == 1)
                    break;
            }
        }
    }

    rep(78500)
    {
        if (L[i] > 0)
        {
            ans *= mod_pow(p[i], L[i]);
            ans %= MOD;
        }
        // if (mod_pow(p.at(i), L.at(p.at(i))) > 1)
        //     cout << p.at(i) << " " << mod_pow(p.at(i), L.at(p.at(i))) << endl;
    }
    cout << ans << endl;

    return 0;
}
// #include <bits/stdc++.h>
#include <iostream>  // cin, cout, string
#include <algorithm> // sort, min/max, upper/lower_bound, transform, count/copy_if
#include <vector>
#include <utility> // pair, swap
#include <functional>
#include <iomanip> // setprecision
#include <map>
#include <set> // multiset
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <stack>
#include <queue> // priority_queue
#include <deque>
#include <bitset>
#include <array>
#include <list>
#include <forward_list>
#include <complex>
#include <ratio>
#include <cassert>
#include <numeric> // accumulate, itoa
#include <random>  // mt19937
#include <iterator>
#include <chrono>
#include <cstring>

using namespace std;

// #define int long long

using i64 = int64_t;
using ll = long long;
using ld = long double;

template <typename T>
using vec = vector<T>;
template <typename T>
using mat = vec<vec<T>>;
template <typename T>
using dic = unordered_map<string, T>;
template <typename T>
using pqg = priority_queue<T, vector<T>, greater<T>>; // dijkstra
// template<typename T, typename U> using P = pair<T, U>;
// template<typename... Args> using func = function<Args...>;
// template<typename T> using pq = priority_queue<T>;

using pii = pair<int, int>;
using ppi = pair<pii, int>;
using pip = pair<int, pii>;
using ppp = pair<pii, pii>;

using vi = vec<int>;
using mi = mat<int>; // Graph
using vp = vec<pii>;

constexpr int IINF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
// constexpr int INF = sizeof(int) == sizeof(long long) ? LINF : IINF;
constexpr long long MOD = 1e9 + 7;

#define _overload(_1, _2, _3, name, ...) name
#define _rep1(i, a, b) for (int i = (a), _##i = (b); i < _##i; ++i)
#define _rep2(i, n) _rep1(i, 0, n)
#define _rep3(n) _rep2(i, n)
#define rep(...) _overload(__VA_ARGS__, _rep1, _rep2, _rep3)(__VA_ARGS__)
#define _rrep1(i, a, b) for (int i = (b)-1, _##i = (a); i >= _##i; --i)
#define _rrep2(i, n) _rrep1(i, 0, n)
#define _rrep3(n) _rrep2(i, n)
#define rrep(...) _overload(__VA_ARGS__, _rrep1, _rrep2, _rrep3)(__VA_ARGS__)

#define each(i, a) for (auto &&i : a)
#define each2(i, a) for (const auto &i : a)

#define pb push_back
// emplace_back(*) == push_back(constructor(*))
#define eb emplace_back
#define pob pop_back
#define pf push_front
#define pof pop_front

#define np next_permutation
#define pp prev_permutation

// make_pair(A, B) == pair<T, U>(A, B)
#define mp make_pair
// mt(...) == tie(...)
#define mt make_tuple

#define ft first
#define sd second

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)(a).size()
#define rev(a) reverse(all(a))
#define rs(a, l) (a).resize(l)

#define upper(s) transform(all(s), (s).begin(), topper)
#define lower(s) transform(all(s), (s).begin(), tolower)

#define sum(a) accumulate(all(a), 0)
#define elif else if
#define unless(a) if (!(a))
#define qt(a) #a

#define endl '\n'
#define dec(n) fixed << setprecision(n)
#define zfl(n) setfill(‘0’) << setw(n)

template <typename T = int, T l = 0, T r = (T)MOD>
auto rnd = bind(uniform_int_distribution<T>(l, r), mt19937(chrono::steady_clock::now().time_since_epoch().count()));

template <typename T>
inline constexpr T gcd(T a, T b)
{
    if (a == 0 || b == 0)
        return 0;
    while (b)
    {
        a = a % b;
        swap(a, b);
    }
    return a;
}
template <typename T>
inline constexpr T extgcd2(T a, T b, T &x, T &y)
{
    x = 1;
    y = 0;
    while (b)
    {
        T t = a / b;
        a -= t * b;
        swap(a, b);
        x -= t * y;
        swap(x, y);
    }
    return a;
}
template <typename T>
inline constexpr T lcm(T a, T b) { return a / gcd(a, b) * b; }

template <typename T>
inline constexpr bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <typename T>
inline constexpr bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename A, typename B>
istream &operator>>(istream &is, pair<A, B> &p)
{
    is >> p.first;
    is >> p.second;
    return is;
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p)
{
    os << p.first << " " << p.second;
    return os;
}

template <typename T>
istream &operator>>(istream &is, vector<T> &v)
{
    for (auto &&x : v)
        is >> x;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    for (int i = 0; i < (int)v.size(); ++i)
        cout << v[i] << (i + 1 != (int)v.size() ? " " : "");
    return os;
}

#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg>
void __f(const char *name, const Arg &arg)
{
    cerr << name << " : " << arg << endl;
}
template <typename Arg, typename... Args>
void __f(const char *names, const Arg &arg, const Args &... args)
{
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg << " | ";
    __f(comma + 1, args...);
}

inline auto yes(const bool &c) { return c ? "yes" : "no"; }
inline auto Yes(const bool &c) { return c ? "Yes" : "No"; }
inline auto YES(const bool &c) { return c ? "YES" : "NO"; }
inline auto Possible(const bool &c) { return c ? "Possible" : "Impossible"; }
inline auto POSSIBLE(const bool &c) { return c ? "POSSIBLE" : "IMPOSSIBLE"; }

constexpr int lim = 100007; // 10^5+7

int n;

int L[78500];
ll p[78500];
vec<ll> a;

constexpr ll a_max = 1000010;
ll inv[a_max];
bool check[a_max];
void setPrime()
{
    bool f;
    int c = 1;
    p[0] = 2;
    rep(i, 3, a_max)
    {
        f = true;
        for (int j = 0; j < c; j++)
        {
            ll pr = p[j];
            // cout << pr << " " << j << " " << i << " " << c << endl;
            if (i % pr == 0)
            {
                f = false;
                break;
            }
            if (pr * pr > i)
            {
                break;
            }
        }

        if (f)
        {
            p[c] = i;

            c += 1;
        }
    }
}

ll mod_inv(ll a)
{
    if (inv[a] > 0)
        return inv[a];
    ll b = MOD, u = 1, v = 0, _a = a;
    while (b)
    {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= MOD;
    if (u < 0)
        u += MOD;
    inv[_a] = u;
    return u;
}

ll mod_pow(ll a, ll n)
{
    ll res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

signed main()
{
    // cin.tie(0);
    // cout.tie(0);
    // ios_base::sync_with_stdio(false);
    setPrime();
    // rep(p.size()) cout << p.at(i) << " ";
    cin >> n;
    ll ans = 0;
    int e, pr;
    rep(78500) L[i] = 0;
    rep(a_max)
    {
        inv[i] = -1;
        check[i] = false;
    }
    a.resize(n);
    rep(n) cin >> a.at(i);
    rep(n)
    {
        ans = (ans + mod_inv(a.at(i))) % MOD;
        // cout << mod_inv(a) << endl;
        if (!check[a.at(i)])
        {
            check[a.at(i)] = true;
            rep(78498)
            {
                e = 0;
                pr = p[i];
                while (a.at(i) % pr == 0)
                {
                    e++;
                    a.at(i) /= pr;
                }
                if (L[i] < e)
                    L[i] = e;
                if (a.at(i) == 1)
                    break;
            }
        }
    }

    rep(78500)
    {
        if (L[i] > 0)
        {
            ans *= mod_pow(p[i], L[i]);
            ans %= MOD;
        }
        // if (mod_pow(p.at(i), L.at(p.at(i))) > 1)
        //     cout << p.at(i) << " " << mod_pow(p.at(i), L.at(p.at(i))) << endl;
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:110:24: error: extended character ‘ is not valid in an identifier
  110 | #define zfl(n) setfill(‘0’) << setw(n)
      |                        ^
a.cc:110:24: error: extended character ’ is not valid in an identifier
a.cc:457:24: error: extended character ‘ is not valid in an identifier
  457 | #define zfl(n) setfill(‘0’) << setw(n)
      |                        ^
a.cc:457:24: error: extended character ’ is not valid in an identifier
a.cc:405:15: error: redefinition of 'constexpr const int IINF'
  405 | constexpr int IINF = 0x3f3f3f3f;
      |               ^~~~
a.cc:58:15: note: 'constexpr const int IINF' previously defined here
   58 | constexpr int IINF = 0x3f3f3f3f;
      |               ^~~~
a.cc:406:21: error: redefinition of 'constexpr const long long int LINF'
  406 | constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
      |                     ^~~~
a.cc:59:21: note: 'constexpr const long long int LINF' previously defined here
   59 | constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
      |                     ^~~~
a.cc:408:21: error: redefinition of 'constexpr const long long int MOD'
  408 | constexpr long long MOD = 1e9 + 7;
      |                     ^~~
a.cc:61:21: note: 'constexpr const long long int MOD' previously defined here
   61 | constexpr long long MOD = 1e9 + 7;
      |                     ^~~
a.cc:460:6: error: redefinition of 'template<class T, T l, T r> auto rnd'
  460 | auto rnd = bind(uniform_int_distribution<T>(l, r), mt19937(chrono::steady_clock::now().time_since_epoch().count()));
      |      ^~~
a.cc:113:6: note: 'template<class T, T l, T r> auto rnd<T, l, r>' previously declared here
  113 | auto rnd = bind(uniform_int_distribution<T>(l, r), mt19937(chrono::steady_clock::now().time_since_epoch().count()));
      |      ^~~
a.cc:463:20: error: redefinition of 'template<class T> constexpr T gcd(T, T)'
  463 | inline constexpr T gcd(T a, T b)
      |                    ^~~
a.cc:116:20: note: 'template<class T> constexpr T gcd(T, T)' previously declared here
  116 | inline constexpr T gcd(T a, T b)
      |                    ^~~
a.cc:475:20: error: redefinition of 'template<class T> constexpr T extgcd2(T, T, T&, T&)'
  475 | inline constexpr T extgcd2(T a, T b, T &x, T &y)
      |                    ^~~~~~~
a.cc:128:20: note: 'template<class T> constexpr T extgcd2(T, T, T&, T&)' previously declared here
  128 | inline constexpr T extgcd2(T a, T b, T &x, T &y)
      |                    ^~~~~~~
a.cc:490:20: error: redefinition of 'template<class T> constexpr T lcm(T, T)'
  490 | inline constexpr T lcm(T a, T b) { return a / gcd(a, b) * b; }
      |                    ^~~
a.cc:143:20: note: 'template<class T> constexpr T lcm(T, T)' previously declared here
  143 | inline constexpr T lcm(T a, T b) { return a / gcd(a, b) * b; }
      |                    ^~~
a.cc:493:23: error: redefinition of 'template<class T> constexpr bool chmax(T&, const T&)'
  493 | inline constexpr bool chmax(T &a, const T &b)
      |                       ^~~~~
a.cc:146:23: note: 'template<class T> constexpr bool chmax(T&, const T&)' previously declared here
  146 | inline constexpr bool chmax(T &a, const T &b)
      |                       ^~~~~
a.cc:503:23: error: redefinition of 'template<class T> constexpr bool chmin(T&, const T&)'
  503 | inline constexpr bool chmin(T &a, const T &b)
      |                       ^~~~~
a.cc:156:23: note: 'template<class T> constexpr bool chmin(T&, const T&)' previously declared here
  156 | inline constexpr bool chmin(T &a, const T &b)
      |                       ^~~~~
a.cc:514:10: error: redefinition of 'template<class A, class B> std::istream& operator>>(std::istream&, std::pair<_T1, _T2>&)'
  514 | istream &operator>>(istream &is, pair<A, B> &p)
      |          ^~~~~~~~
a.cc:167:10: note: 'template<class A, class B> std::istream& operator>>(std::istream&, std::pair<_T1, _T2>&)' previously declared here
  167 | istream &operator>>(istream &is, pair<A, B> &p)
      |          ^~~~~~~~
a.cc:521:10: error: redefinition of 'template<class A, class B> std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)'
  521 | ostream &operator<<(ostream &os, const pair<A, B> &p)
      |          ^~~~~~~~
a.cc:174:10: note: 'template<class A, class B> std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)' previously declared here
  174 | ostream &operator<<(ostream &os, const pair<A, B> &p)
      |          ^~~~~~~~
a.cc:528:10: error: redefinition of 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)'
  528 | istream &operator>>(istream &is, vector<T> &v)
      |          ^~~~~~~~
a.cc:181:10: note: 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)' previously declared here
  181 | istream &operator>>(istream &is, vector<T> &v)
      |          ^~~~~~~~
a.cc:535:10: error: redefinition of 'template<class T> std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)'
  535 | ostream &operator<<(ostream &os, const vector<T> &v)
      |          ^~~~~~~~
a.cc:188:10: note: 'template<class T> std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)' previously declared here
  188 | ostream &operator<<(ostream &os, const vector<T> &v)
      |          ^~~~~~~~
a.cc:545:6: error: redefinition of 'template<class Arg> void __f(const char*, const Arg&)'
  545 | void __f(const char *name, const Arg &arg)
      |      ^~~
a.cc:198:6: note: 'template<class Arg> void __f(const char*, const Arg&)' previously declared here
  198 | void __f(const char *name, const Arg &arg)
      |      ^~~
a.cc:550:6: error: redefinition of 'template<class Arg, class ... Args> void __f(const char*, const Arg&, const Args& ...)'
  550 | void __f(const char *names, const Arg &arg, const Args &... args)
      |      ^~~
a.cc:203:6: note: 'template<class Arg, class ... Args> void __f(const char*, const Arg&, const Args& ...)' previously declared here
  203 | void __f(const char *names, const Arg &arg, const Args &... args)
      |      ^~~
a.cc:557:13: error: redefinition of 'auto yes(const bool&)'
  557 | inline auto yes(const bool &c) { return c ? "yes" : "no"; }
      |             ^~~
a.cc:210:13: note: 'auto yes(const bool&)' previously defined here
  210 | inline auto yes(const bool &c) { return c ? "yes" : "no"; }
      |             ^~~
a.cc:558:13: error: redefinition of 'auto Yes(const bool&)'
  558 | inline auto Yes(const bool &c) { return c ? "Yes" : "No"; }
      |             ^~~
a.cc:211:13: note: 'auto Yes(const bool&)' previously defined here
  211 | inline auto Yes(const bool &c) { return c ? "Yes" : "No"; }
      |             ^~~
a.cc:559:13: error: redefinition of 'auto YES(const bool&)'
  559 | inline auto YES(const bool &c) { return c ? "YES" : "NO"; }
      |             ^~~
a.cc:212:13: note: 'auto YES(const bool&)' previously defined here
  212 | inline auto YES(const bool &c) { return c ? "YES" : "NO"; }
      |             ^~~
a.cc:560:13: error: redefinition of 'auto Possible(const bool&)'
  560 | inline auto Possible(const bool &c) { return c ? "Possible" : "Impossible"; }
      |             ^~~~~~~~
a.cc:213:13: note: 'auto Possible(const bool&)' previously defined here
  213 | inline auto Possible(const bool &c) { return c ? "Possible" : "Impossible"; }
      |             ^~~~~~~~
a.cc:561:13: error: redefinition of 'auto POSSIBLE(const bool&)'
  561 | inline auto POSSIBLE(const bool &c) { return c ? "POSSIBLE" : "IMPOSSIBLE"; }
      |             ^~~~~~~~
a.cc:214:13: note: 'auto POSSIBLE(const bool&)' previously defined here
  214 | inline auto POSSIBLE(const bool &c) { return c ? "POSSIBLE" : "IMPOSSIBLE"; }
      |             ^~~~~~~~
a.cc:563:15: error: redefinition of 'constexpr const int lim'
  563 | constexpr int lim = 100007; // 10^5+7
      |               ^~~
a.cc:216:15: note: 'constexpr const int lim' previously defined here
  216 | constexpr int lim = 100007; // 10^5+7
      |               ^~~
a.cc:565:5: error: redefinition of 'int n'
  565 | int n;
      |     ^
a.cc:218:5: note: 'int n' previously declared here
  218 | int n;
      |     ^
a.cc:567:5: error: redefinition of 'int L [78500]'
  567 | int L[78500];
      |     ^
a.cc:220:5: note: 'int L [78500]' previously declared here
  220 | int L[78500];
      |     ^
a.cc:568:4: error: redefinition of 'll p [78500]'
  568 | ll p[78500];
      |    ^
a.cc:221:4: note: 'll p [78500]' previously declared here
  221 | ll p[78500];
      |    ^
a.cc:569:9: error: redefinition of 'vec<long long int> a'
  569 | vec<ll> a;
      |         ^
a.cc:222:9: note: 'vec<long long int> a' previously declared here
  222 | vec<ll> a;
      |         ^
a.cc:571:14: error: redefinition of 'constexpr const ll a_max'
  571 | constexpr ll a_max = 1000010;
      |              ^~~~~
a.cc:224:14: note: 'constexpr const ll a_max' previously defined here
  224 | constexpr ll a_max = 1000010;
      |              ^~~~~
a.cc:572:4: error: redefinition of 'll inv [1000010]'
  572 | ll inv[a_max];
      |    ^~~
a.cc:225:4: note: 'll inv [1000010]' previously declared here
  225 | ll inv[a_max];
      |    ^~~
a.cc:573:6: error: redefinition of 'bool check [1000010]'
  573 | bool check[a_max];
      |      ^~~~~
a.cc:226:6: note: 'bool check [1000010]' previously declared here
  226 | bool check[a_max];
      |      ^~~~~
a.cc:574:6: error: redefinition of 'void setPrime()'
  574 | void setPrime()
      |      ^~~~~~~~
a.cc:227:6: note: 'void setPrime()' previously defined here
  227 | void setPrime()
      |      ^~~~~~~~
a.cc:606:4: error: redefinition of 'll mod_inv(ll)'
  606 | ll mod_inv(ll a)
      |    ^~~~~~~
a.cc:259:4: note: 'll mod_inv(ll)' previously defined here
  259 | ll mod_inv(ll a)
      |    ^~~~~~~
a.cc:626:4: error: redefinition of 'll mod_pow(ll, ll)'
  626 | ll mod_pow(ll a, ll n)
      |    ^~~~~~~
a.cc:279:4: note: 'll mod_pow(ll, ll)' previously defined here
  279 | ll mod_pow(ll a, ll n)
      |    ^~~~~~~
a.cc:639:8: error: redefinition of 'int main()'
  639 | signed main()
      |        ^~~~
a.cc:292:8: note: 'int main()' previously defined here
  292 | signed main()
      |        ^~~~