Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define pss printf
#define MOD 998244353
#define INF 1e18
#define eps 0.00001
#define endl '\n'
#define debug(n1) cout<<n1<<endl
#define int long long
int n,a[200005];
int at[1000005];
int val[1000005];

ll powmod(ll a,ll b)
{
    ll an=1;
    while(b>0)
    {
        if((b&1))
            an=(an*a)%MOD;
        a=(a*a)%MOD;
        b>>=1;
    }
    return an;
}

signed main()
{
    SPEED;
    
    cin>>n;
    
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        at[a[i]]=(at[a[i]]+a[i])%MOD;
    }

    int ans=0;
    
    for(int i=1000000;i>=1;i--)
    {
        int sum=0;
        for(int j=i;j<=1000000;j+=i)
        {
            val[i]=(val[i]-val[j]+MOD)%MOD;
            sum=(sum+at[j])%MOD;
        }
        sum=(sum*1ll*sum)%MOD;
        val[i]=(val[i]+sum)%MOD;
        sum=val[i];
        int cnt=(at[i]*1ll*powmod(i,MOD-2))%MOD;
        sum=(sum-cnt*1ll*i*1ll*i+MOD)%MOD;
        sum=(sum*1ll*powmod(2,MOD-2))%MOD;
        ans = (ans + sum*1ll*powmod(i,MOD-2))%MOD;
    }

    cout<<ans<<endl;
}

Compiler output:
a.cc:24:13: error: 'long long long' is too long for GCC
   24 | #define int long long
      |             ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:29:1: note: in expansion of macro 'll'
   29 | ll powmod(ll a,ll b)
      | ^~
a.cc:24:18: error: 'long long long' is too long for GCC
   24 | #define int long long
      |                  ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:29:1: note: in expansion of macro 'll'
   29 | ll powmod(ll a,ll b)
      | ^~
a.cc:24:13: error: 'long long long' is too long for GCC
   24 | #define int long long
      |             ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:29:11: note: in expansion of macro 'll'
   29 | ll powmod(ll a,ll b)
      |           ^~
a.cc:24:18: error: 'long long long' is too long for GCC
   24 | #define int long long
      |                  ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:29:11: note: in expansion of macro 'll'
   29 | ll powmod(ll a,ll b)
      |           ^~
a.cc:24:13: error: 'long long long' is too long for GCC
   24 | #define int long long
      |             ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:29:16: note: in expansion of macro 'll'
   29 | ll powmod(ll a,ll b)
      |                ^~
a.cc:24:18: error: 'long long long' is too long for GCC
   24 | #define int long long
      |                  ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:29:16: note: in expansion of macro 'll'
   29 | ll powmod(ll a,ll b)
      |                ^~
a.cc: In function 'long long int powmod(long long int, long long int)':
a.cc:24:13: error: 'long long long' is too long for GCC
   24 | #define int long long
      |             ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:31:5: note: in expansion of macro 'll'
   31 |     ll an=1;
      |     ^~
a.cc:24:18: error: 'long long long' is too long for GCC
   24 | #define int long long
      |                  ^~~~
a.cc:7:22: note: in expansion of macro 'int'
    7 | #define ll long long int
      |                      ^~~
a.cc:31:5: note: in expansion of macro 'll'
   31 |     ll an=1;
      |     ^~