Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define modbig (10**9+7)
using namespace std;

ll gcd(ll a,ll b){
  if(a<b){
    ll tmp=a; a=b; b=tmp;
  }
  ll r=a%b;
  while(r!=0){
    a=b;
    b=r;
    r=a%b;
  }
  return b;
}

int main(){
  ll inv[1000000]; inv[1]=1;
  for(int i=2;i<=1000000;i++){
    inv[i]=modbig-inv[modbig%i]*(modbig/i)%modbig;
  }
  ll n; cin>>n; ll a[n];
  rep(i,n){
    cin>>a[i];
  }
  ll ans=0,lcm=a[0];
  rep(i,n){
    ans+=inv[a[i]];
    ans%=modbig;
  }
  for(int i=1;i<n;i++){
    lcm*=a[i]; lcm%=modbig;
    ll tmp=gcd(lcm,a[i])%modbig;
    lcm*=inv[tmp]; lcm%=modbig;
  }
  ans*=lcm; cout<<ans%modbig;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:32:12: note: in expansion of macro 'modbig'
   32 |     inv[i]=modbig-inv[modbig%i]*(modbig/i)%modbig;
      |            ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:32:23: note: in expansion of macro 'modbig'
   32 |     inv[i]=modbig-inv[modbig%i]*(modbig/i)%modbig;
      |                       ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:32:34: note: in expansion of macro 'modbig'
   32 |     inv[i]=modbig-inv[modbig%i]*(modbig/i)%modbig;
      |                                  ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:32:44: note: in expansion of macro 'modbig'
   32 |     inv[i]=modbig-inv[modbig%i]*(modbig/i)%modbig;
      |                                            ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:41:10: note: in expansion of macro 'modbig'
   41 |     ans%=modbig;
      |          ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:44:21: note: in expansion of macro 'modbig'
   44 |     lcm*=a[i]; lcm%=modbig;
      |                     ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:45:26: note: in expansion of macro 'modbig'
   45 |     ll tmp=gcd(lcm,a[i])%modbig;
      |                          ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:46:25: note: in expansion of macro 'modbig'
   46 |     lcm*=inv[tmp]; lcm%=modbig;
      |                         ^~~~~~
a.cc:13:20: error: invalid type argument of unary '*' (have 'int')
   13 | #define modbig (10**9+7)
      |                    ^~
a.cc:48:23: note: in expansion of macro 'modbig'
   48 |   ans*=lcm; cout<<ans%modbig;
      |                       ^~~~~~