MTX-Editorial

Here is the solution


<h2>
const int MAX=1600000;
vector <long long> p(1600000);
void solve(){
    for(int i=0; i < MAX ; i++ ) p[i]=1;
    for(int i=2; i < MAX; i+=2){
        int j=i, c=0;
        while (j%2==0) {j/=2; c++;};
        p[i]*=(c+1);
    }
    for(int i=3; i < MAX; i+=2){
        if(p[i]==1)
        for(int j=i; j < MAX;j+=i){
            int  x=j, c=0;
            while(x%i==0){x/=i; c++;}
            p[j]*=(c+1);
        }
    }p[0]=0;
    for(int i=1; i < MAX; i++) p[i]+=p[i-1];
}
int main(){
    solve();
    cin.sync_with_stdio(false);
   
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        if(n==1||n==2){cout << 0 << endl; continue;}
        long long s=0;
        for(int i=1; i < n-i; i++){
            int x=i*(n-i);
            s+=p[x-1];
        }s*=2;
        if(n%2==0){
            n/=2;
            s+=p[n*n-1];
        }cout << s << endl;
    }
}