Language: C++

#if __has_include("D:/dhiraj/Programming/debug.h") && __has_include(<stdint.h>)
	#include "D:/dhiraj/Programming/debug.h"
#else
	#include <bits/stdc++.h>
	using namespace std;
	#define line 1
	#define d(...) 2
#endif

// Function declaration
void solve();

// Data Type
#define ull                 unsigned long long int
#define ll                  long long int
#define ld                  long double

// Loops
#define loop(i,s,e)         for(ll i=(s);i<(e);i++)
#define rloop(i,s,e)        for(ll i=(s);i>=(e);i--)

// Stl
#define pb                  push_back
#define pf                  push_front
#define eb                  emplace_back
#define popb                pop_back
#define popf                pop_front
#define mp                  make_pair
#define mt                  make_tuple
#define ff                  first
#define ss                  second
#define vll                 vector<ll>
#define pll                 pair<ll,ll>
#define ub                  upper_bound                
#define lb                  lower_bound
#define bs                  binary_search        
#define all(x)              begin(x),end(x)
#define get(ind,tup)        get<ind>(tup)

// Maths
#define PI                  (2*acos(0.0))
#define gcd(a,b)            __gcd((a),(b))
#define lcm(a,b)            ((a)/(__gcd((a),(b)))*(b))
#define log(x,b)            (log(x)/log(b))
#define INF                 LLONG_MAX

// Big data
const int Mod = 1e9+7;
#define Mul(a,b)            (((a) % Mod)*((b) % Mod)) % Mod
#define Sum(a,b)            (((a) % Mod)+((b) % Mod)) % Mod
#define Sub(a,b)            (((a) % Mod)-((b) % Mod) + Mod) % Mod
#define Div(a,b)			Mul(a,modInverse(b))

// Bit-Manipulation
#define setbit(n,pos)       n |= (1LL<<pos)
#define resetbit(n,pos)     n &= (~(1LL<<pos))
#define toogle(n,pos)       n ^= (1LL<<pos)
#define atpos(n,pos)        ((n&(1LL<<pos))!=0)
#define bits(n)             (floor(log2(n)) + 1)
#define firstone(n)         __builtin_ffs(n)
#define countone(n)         __builtin_popcount(n)

// Extra
#define fast                ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define scan(any)           for(auto &i:any) cin>>i;
#define scanp(any)          for(auto &i:any) cin>>i.ff>>i.ss;
#define print(any)          for(auto &i:any) cout<<i<<" "; nl;
#define printp(any)         for(auto &i:any) cout<<i.ff<<" "<<i.ss<<endl;
#define flush               cout.flush()
#define nl                  cout<<'\n'
#define endl                '\n'    

int main()
{
	#ifdef Dhiraj
		freopen("D:/dhiraj/Programming/input.txt","r",stdin);
		freopen("D:/dhiraj/Programming/output.txt","w",stdout);
	#endif
	
	fast;
	int t = 1;
	while(t--)
		solve();
	return 0;
}

const ll size = 1e6+7;
ll fre[size];
void primeFact(ll n)
{
	if(n<=1) return;
	ll cnt = 0;
	while(n%2==0)
	{
		n/=2;
		cnt++;
	}
	fre[2] = max(fre[2],cnt);

	for(ll i=3;i<=sqrt(n);i+=2)
	{
		cnt = 0;
		while(n%i==0)
		{
			n/=i;
			cnt++;
		}
		fre[i] = max(fre[i],cnt);
	}
	if(n>2) fre[n] = max(fre[n],1);
}

ll power(ll x, ll y, ll p = Mod) 
{ 
    ll res = 1;
    x = x % p; 
    while(y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p;   
        y = y>>1;
        x = (x*x) % p;   
    } 
    return res;
}
ll modInverse(ll b,ll m = Mod) 
{ 
    // gcd(b,m) must 1
    // m must be prime
    return power(b,m-2,m);
}

void solve()
{
	ll n;
	cin>>n;
	
	vll a(n);
	scan(a);

	loop(i,0,n) 
		primeFact(a[i]);

	loop(i,0,size)
		if(fre[i])
			fre[i] = power(i,fre[i]);
	
	ll lcm = 1;
	loop(i,0,size)
		if(fre[i])
			lcm = Mul(lcm,fre[i]);
	
	ll sum = 0;
	loop(i,0,n)
		sum = Sum(sum,Div(lcm,a[i]));

	cout<<sum<<endl;
}

Compiler output:
a.cc:88:8: error: reference to 'size' is ambiguous
   88 | ll fre[size];
      |        ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:87:10: note:                 'const long long int size'
   87 | const ll size = 1e6+7;
      |          ^~~~
a.cc: In function 'void primeFact(long long int)':
a.cc:98:9: error: 'fre' was not declared in this scope; did you mean 'free'?
   98 |         fre[2] = max(fre[2],cnt);
      |         ^~~
      |         free
a.cc: In function 'void solve()':
a.cc:144:18: error: reference to 'size' is ambiguous
  144 |         loop(i,0,size)
      |                  ^~~~
a.cc:19:45: note: in definition of macro 'loop'
   19 | #define loop(i,s,e)         for(ll i=(s);i<(e);i++)
      |                                             ^
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:87:10: note:                 'const long long int size'
   87 | const ll size = 1e6+7;
      |          ^~~~
a.cc:145:20: error: 'fre' was not declared in this scope; did you mean 'free'?
  145 |                 if(fre[i])
      |                    ^~~
      |                    free
a.cc:149:18: error: reference to 'size' is ambiguous
  149 |         loop(i,0,size)
      |                  ^~~~
a.cc:19:45: note: in definition of macro 'loop'
   19 | #define loop(i,s,e)         for(ll i=(s);i<(e);i++)
      |                                             ^
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:87:10: note:                 'const long long int size'
   87 | const ll size = 1e6+7;
      |          ^~~~
a.cc:150:20: error: 'fre' was not declared in this scope; did you mean 'free'?
  150 |                 if(fre[i])
      |                    ^~~
      |                    free