stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <string>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

using namespace std;

using ll = long long;



struct Sieve {

    Sieve(int n) : l(n + 1, 0) {

        for (int i = 2; i <= n; i++) {

            if (!l[i]) p.push_back(l[i] = i);

            for (int q : p) {

                if (q > l[i]) break;

                if (int j = i * q; j <= n) l[j] = q; else break;

            }

        }

    }

    bool is_prime(int i) {

        return l[i] == i;

    }

    vector<int> l, p;

};



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);



    int n;

    cin >> n;



    Sieve si(n);

    ll r = 0;



    for (int i = 1; i <= n; i++) {

        int t = i, d = 1;

        while (t > 1) {

            int k = 1;

            int l = si.l[t];

            while (t % l == 0) t /= l, k++;

            d *= k;

        }

        r += (ll)i * d;

    }



    cout << r << endl;



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.5826597140602177x):
#include <iostream>

#include <vector>

#include <string>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

using namespace std;

using ll = long long;



int main() {

    int n;

    cin >> n;



    ll r = 0;

    for (int i = 1; i <= n; i++) {

        ll k = n / i;

        r += i * (k * (k + 1) / 2);

    }



    cout << r << endl;



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <string>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

using namespace std;

using ll = long long;



struct Sieve {

    Sieve(int n) : l(n + 1, 0) {

        for (int i = 2; i <= n; i++) {

            if (!l[i]) p.push_back(l[i] = i);

            for (int q : p) {

                if (q > l[i]) break;

                if (int j = i * q; j <= n) l[j] = q; else break;

            }

        }

    }

    bool is_prime(int i) {

        return l[i] == i;

    }

    vector<int> l, p;

};



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);



    int n;

    cin >> n;



    Sieve si(n);

    ll r = 0;



    for (int i = 1; i <= n; i++) {

        int t = i, d = 1;

        while (t > 1) {

            int k = 1;

            int l = si.l[t];

            while (t % l == 0) t /= l, k++;

            d *= k;

        }

        r += (ll)i * d;

    }



    cout << r << endl;



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.9034225059167795x):
#include <iostream>

#include <vector>

#include <string>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

using namespace std;

using ll = long long;



int main() {

    int n;

    cin >> n;



    ll r = 0;

    for (int i = 1; i * i <= n; i++) {

        r += i * i;

        r += (ll)(n / i - i) * i * (n / i + (i + 1));

    }



    cout << r << endl;



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <map>

#include <unordered_map>

#include <set>

#include <unordered_set>

#include <cmath>

#include <algorithm>

#include <climits>

#include <iomanip>

#define endl "\n"

#define debug(x) cout << #x << " : " << x << endl;

#define debug2(x, y) cout << #x << " : " << x  << ", " << #y << " : " << y << endl;

#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);

typedef long long ll;

using namespace std;



int main()

{

	FASTIO

	

	ll n;

	cin >> n;

	

	vector <ll> ans(n + 10, 1);

	for(ll i = 2; i <= n; i ++)	

	{

		if(ans[i] == 1)

		{

			ans[i] = 2;

			for(ll j = 2; i * j <= n; j ++)

			{

				ll val = i * j;

				ll count = 0;

				while(val % i == 0)

				{

					val /= i;

					count ++;

				}

					

				ans[i * j] *= (count + 1);

			}

		}

	}





	ll res = 0;

	for(ll i = 1; i <= n; i ++)

	{

		if(i != 1 && ans[i] == 1)

			ans[i] = 2;

		// debug(i * ans[i])

		res += (i * ans[i]);

	}



	cout << res << endl;

}

// Faster C++ solution for the same problem (measured speedup: 3.00383992728569x):
#include <iostream>

#include <vector>

#include <map>

#include <unordered_map>

#include <set>

#include <unordered_set>

#include <cmath>

#include <algorithm>

#include <climits>

#include <iomanip>

#define endl "\n"

#define debug(x) cout << #x << " : " << x << endl;

#define debug2(x, y) cout << #x << " : " << x  << ", " << #y << " : " << y << endl;

#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);

typedef long long ll;

using namespace std;



int main()

{

	FASTIO

	

	ll n;

	cin >> n;

	

	ll ans = 0;

	for(ll i = 1; i <= n; i ++)

	{

		ll last = n / i;

		ans = ans + (i *  (last * (last + 1))) / 2;

	}	

	cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

typedef long long ll;



int main() {

    int n;

    cin >> n;



    vector<ll> f(n);

    for (int i = 0; i < n; i++) {

        ll x = i + 1;

        while (x <= n) {

            f[x - 1]++;

            x += i + 1;

        }

    }



    ll res = 0;

    for (int i = 0; i < n; i++) {

        res += (i + 1) * f[i];

    }

    cout << res << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.60174463108599x):
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

typedef long long ll;



int main() {

    int n;

    cin >> n;



    ll ans = 0;

    for (int i = 1; i <= n; i++) {

        ll m = n / i;

        ans += i * m * (m + 1) / 2;

    }

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)

#define rep2(i, s, n) rep3(i, s, n, 1)

#define rep(i, n) rep2(i, 0, n)



using namespace std;

using ll = long long;

using ull = unsigned long long;

using P = pair<int, int>;



int main(){

    ll n, sum=0;

    cin >> n;

    vector<ll> cnt(n+1, 0);

    for(ll i=1;i<n+1;i++){

        // ll cnt=0;

        // for(ll j=1;j*j<=i;j++){

        //     if(i%j==0){

        //         if(j*j==i){

        //             cnt++;

        //         }else{

        //             cnt += 2;

        //         }

        //     }

        // }

        ll x = i;

        while(x<n+1){

            cnt[x]++;

            x += i;

        }

        sum += i * cnt[i];

    }

    cout << sum << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.602487150581215x):
#include <bits/stdc++.h>

#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)

#define rep2(i, s, n) rep3(i, s, n, 1)

#define rep(i, n) rep2(i, 0, n)



using namespace std;

using ll = long long;

using ull = unsigned long long;

using P = pair<int, int>;



int main(){

    ll n, sum=0;

    cin >> n;

    rep2(i, 1, n+1){

        sum += i * (n / i) * (n / i + 1) / 2;

    }

    cout << sum << endl;

    return 0;

}
// Slower C++ solution:
#include <cmath>

#include <iostream>

#include <map>

#include <numeric>

#include <vector>



using namespace std;

using ll = long long;



int a(int x, int p) {

  int ret{};

  while (x%p==0) {

    ++ret;

    x /= p;

  }

  return ret;

}



int main() {

  ll N;

  cin >> N;

  vector<ll> nd(N + 1);

  nd[1] = 1;



  vector<bool> sieve(N + 1, true);

  for (int i = 2; i < N + 1; ++i) {

    if (!sieve[i])

      continue;

    for (int j = 2 * i; j < N + 1; j += i) sieve[j] = false;

  }

  

  ll ans{1};

  for (int i = 2; i <= N; ++i) {

    if (sieve[i]) nd[i] = 2;

    else {

      for (int j = 2; j * j <= i; ++j) {

        if (i % j == 0) {

          auto x = a(i,j);

          if (x>1) nd[i] = nd[i/j] / x * (x+1);

          else nd[i] = nd[i/j] * 2;

          break;

        }

      }

    }

    //    cout << i << " " << nd[i] << endl;

    ans += i * nd[i];

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 2.34843579932995x):
#include <iostream>



using namespace std;

using ll = long long;



int main() {

  ll N, ans{};

  cin >> N;

  for (int i = 1; i <= N; ++i) {

    ans += (N - N % i + i) * (N / i) / 2;

  }

  cout << ans << endl;

}
// Slower C++ solution:
#include "iostream"

#include "climits"

#include "list"

#include "queue"

#include "stack"

#include "set"

#include "functional"

#include "algorithm"

#include "string"

#include "map"

#include "unordered_map"

#include "unordered_set"

#include "iomanip"

#include "cmath"

#include "random"

#include "bitset"

#include "cstdio"

#include "numeric"

#include "cassert"

#include "ctime"



using namespace std;



constexpr long long int MOD = 1000000007;

//constexpr int MOD = 1000000007;

//constexpr int MOD = 998244353;

//constexpr long long int MOD = 998244353;

constexpr double EPS = 1e-9;



//int N, M, K, H, W, L, R;

long long int N, M, K, H, W, L, R;





int main() {

	ios::sync_with_stdio(false);

	cin.tie(0);



	cin >> N;

	vector<int>num(N + 10);

	num[1] = 1;

	vector<int>p;

	p.push_back(2);

	num[2] = 2;

	for (int i = 3; i <= N; i++) {

		int m = i;

		for(auto j:p){

			if (j*j > i)break;

			if (i%j == 0) {

				m = j;

				break;

			}

		}

		if (m == i) {

			num[i] = 2;

		}

		else {

			int box = i;

			int add = 0;

			while (box%m == 0) {

				box /= m;

				add++;

			}

			num[i] = num[i / m] / add * (add + 1);

		}

		if (num[i] == 2)p.push_back(i);

	}

	long long int ans = 0;

	for (int i = 1; i <= N; i++) {

		ans += 1LL * num[i] * i;

	}

	cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 4.339814134545957x):
#include "iostream"

#include "climits"

#include "list"

#include "queue"

#include "stack"

#include "set"

#include "functional"

#include "algorithm"

#include "string"

#include "map"

#include "unordered_map"

#include "unordered_set"

#include "iomanip"

#include "cmath"

#include "random"

#include "bitset"

#include "cstdio"

#include "numeric"

#include "cassert"

#include "ctime"



using namespace std;



constexpr long long int MOD = 1000000007;

//constexpr int MOD = 1000000007;

//constexpr int MOD = 998244353;

//constexpr long long int MOD = 998244353;

constexpr double EPS = 1e-9;



//int N, M, K, H, W, L, R;

long long int N, M, K, H, W, L, R;



int main() {

	ios::sync_with_stdio(false);

	cin.tie(0);



	cin >> N;

	long long int ans = 0;

	for (int i = 1; i <= N; i++) {

		long long int box = N / i;

		ans += box * (box + 1) / 2 * i;

	}

	cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

using ll = long long ;

using P = pair<int,int> ;

using pll = pair<long long,long long>;

constexpr int INF = 1e9;

constexpr long long LINF = 1e17;

constexpr int MOD = 1000000007;

constexpr double PI = 3.14159265358979323846;



struct Sieve {

    int n;

    vector<int> f,primes;

    

    Sieve(int n=1):n(n),f(n+1){

        f[0] = f[1] = -1;

        for(long long i=2;i<=n;++i){

            if(f[i]) continue;

            primes.push_back(i);

            f[i] = i;

            for(long long j = i*i;j <= n;j += i) {

                if(!f[j]) f[j] = i;

            }

        }

    }

    

    bool isPrime(int x){return f[x] == x;}

    

    vector<int> factorList(int x){

        vector<int> res;

        while(x != 1){

            res.push_back(f[x]);

            x /= f[x];

        }

        return res;

    }

    

    vector<pair<int,int>> factor(int x){

        vector<int> fl = factorList(x);

        if(fl.size() == 0) return {};

        vector<pair<int,int>> res(1,pair<int,int>(fl[0],0));

        for(int p:fl){

            if(res.back().first == p){

                res.back().second ++;

            }else{

                res.emplace_back(p,1);

            }

        }

        return res;

    }



    long long divisorCalc(long long x){

        long long res = 1;

        long long now = -1;

        long long nowCnt = 0;

        while(x != 1){

            if(now==f[x]) ++ nowCnt;

            else{

                res *= nowCnt + 1;

                now = f[x];

                nowCnt = 1;

            }

            x /= f[x];

        }

        res *= nowCnt+1;

        return res;

    }     

};



int main(){

    int N; cin >> N;

    Sieve siv(N + 1);

    ll ans = 0;

    rep(i,N) {

        ans += (ll)(i + 1)*(ll)siv.divisorCalc(i + 1);

    }

    cout << ans << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.4943161963623686x):
#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

using ll = long long ;

using P = pair<int,int> ;

using pll = pair<long long,long long>;

constexpr int INF = 1e9;

constexpr long long LINF = 1e17;

constexpr int MOD = 1000000007;

constexpr double PI = 3.14159265358979323846;



int main(){

    int N; cin >> N;

    ll ans = 0;

    for (int i =1;i <= N;++i){

        for (int j = i;j <= N;j += i) {

            ans += (ll)j;

        }

    }

    cout << ans << endl;

    return 0;

}
// Slower C++ solution:
#include<stdio.h>

#pragma GCC optimize ("O2")

int main(void)

{

  int K,div,N;long long a=0;K=scanf("%d",&N);

  while(K<=N){div=N/K;a+=1ll*K++*div*(div+1)/2;}

  return printf("%lld\n",a),0;

}

// Faster C++ solution for the same problem (measured speedup: 15.233574943485399x):
#include<stdio.h>

#pragma GCC optimize ("O2")

int main(void)

{

  int div,K,N;long long a=0;K=scanf("%d",&N);

  if(N<2)return printf("%d\n",N),0;

  while(K*K<=N){div=N/K;a+=1ll*K*(div+K)*(div-K+1);K++;}

  K--;a-=1ll*K*(K+1)*(2*K+1)/6;

  return printf("%lld\n",a),0;

}
// Slower C++ solution:
#include<stdio.h>

#pragma GCC optimize ("O2")

int main(void)

{

  int K,div,N;long long a=0;K=scanf("%d",&N);

  while(K<=N){div=N/K;a+=1ll*K++*div*(div+1)/2;}

  return printf("%lld\n",a),0;

}

// Faster C++ solution for the same problem (measured speedup: 14.82427126858046x):
#include<stdio.h>

#pragma GCC optimize ("O2")

typedef long long LL;

static inline int IN(void)

{

  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}

  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;

}

void OUT(LL x){if(x<0)putchar('-'),x=-x;if(x>=10)OUT(x/10);putchar(x%10+48);}

int main(void)

{

  static int div,K=1;int N=IN();static LL a=0;

  while(K<=N){div=N/(N/K)+1;a+=1ll*(div-K)*(K+div-1)*(N/K)*(N/K+1)/4;K=div;}

  return OUT(a),0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;



template <typename T>

struct PrimeFact {

    vector<T> spf;

    PrimeFact(T N) { init(N); }

    void init(T N) { // 前処理。spf を求める

        spf.assign(N + 1, 0);

        for (T i = 0; i <= N; i++) spf[i] = i;

        for (T i = 2; i * i <= N; i++) {

            if (spf[i] == i) {

                for (T j = i * i; j <= N; j += i) {

                    if (spf[j] == j) {

                        spf[j] = i;

                    }

                }

            }

        }

    }

    T get(T n) { // nの素因数分解を求める

        T p = 0, cnt = 0, res = 1;

        while (n != 1) {

          if (p == spf[n])

            cnt++;

          else {

            res *= cnt+1;

            p = spf[n];

            cnt = 1;

          }

          n /= spf[n];

        }

        res *= cnt+1;

        return res;

    }

};



int main() {

  int N;

  cin >> N;

  PrimeFact<ll> P(N+1);

  ll ans = 0;

  for (int i=1; i<=N; i++) {

    ans += i*P.get(i);

  }

  cout << ans << endl;

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.011101016167788x):
#include <bits/stdc++.h>

using namespace std;

using ll = long long;



int main() {

  int N;

  cin >> N;

  ll ans = 0;

  for (int i=1; i<=N; i++) {

    for (int j=i; j<=N; j+=i) {

      ans += j;

    }

  }

  cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;





int main() {

  int N;

  cin >> N;

  vector<int64_t> data(N, 1);

  int64_t ans = 0;

  for(int i = 2; i <= N; i++) {

    if(data.at(i - 1) == 1) {

      for(int j = 1; j * i <= N; j++) {

        int64_t count = 1;

        int a = j;

        while(a % i == 0 && a >= i) {

          a /= i;

          count++;

        }

        data.at(j * i - 1) *= count + 1;

      }

    }

  }

  for(int i = 0; i < N; i++) {

    ans += (i + 1) * data.at(i);

  }

  cout << ans << endl;  

}

// Faster C++ solution for the same problem (measured speedup: 2.0853418725757855x):
#include <bits/stdc++.h>

using namespace std;





int main() {

  int64_t N;

  cin >> N;

  int64_t ans = 0;

  for(int i = 1; i <= N; i++) {

    int64_t y = N / i;

    ans += y * (y + 1) * i / 2;

  }

  cout << ans << endl;

}
// Slower C++ solution:
#include <stdio.h>

#define LL long long

LL ans,b;

int n,prime[2000],not_prime[10010],tot;

void linear_shaker(int x){

	int i,j;

	for(i=2;i<=x;i++){

		if(!not_prime[i])prime[++tot]=i;

		for(j=1;prime[j]*i<=x;j++){

			not_prime[prime[j]*i]=1;

			if(i%prime[j]==0)break;

		}

	}

}

int main(){

	int i,n,cnt,x,j;

	linear_shaker(10000);

	ans=0;

	scanf("%d",&n);

	for(i=1;i<=n;i++){

		x=i,b=1;

		for(j=1;prime[j]*prime[j]<=x;j++){

			cnt=0;

			if(x%prime[j]==0){

				while(x%prime[j]==0)x/=prime[j],cnt++;

				b*=(cnt+1);

			}

		}

		if(x>1)b*=2;

		ans+=b*i;

	}

	printf("%lld\n",ans);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.6458337179078093x):
#include <stdio.h>

#define LL long long

LL ans;

int main(){

	int n,i,m,a,b;

	scanf("%d",&n);

	for(i=1;i<=n;i++){

		m=n/i;

		a=i,b=a+(m-1)*i;

		ans+=(LL)(a+b)*m/2;

	}

	printf("%lld\n",ans);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



using ll = long long;



int main(){



  int N;

  cin >> N;



  vector<ll> num(N+1);

  ll ans=0;

  for(ll i=1;i<=N;i++){

    for(ll j=i;j<=N;j=j+i){

      num[j]++;

    }

    ans+=i*num[i];

  }



  cout << ans << endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.6563396923911884x):
#include<bits/stdc++.h>

using namespace std;



using ll = long long;



ll sum(ll N){

  return N*(N+1)/2;

}



int main(){



  int N;

  cin >> N;



  ll g = N*(N+1)/2;



  ll ans=0;

  for(ll i=1;i<=N;i++){

    ans+=i*sum(ll(N/i));

  }



  cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define P pair<ll,ll>

#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)

#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)

#define TO(x,t,f) ((x)?(t):(f))

#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9

#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted

#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted

#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted

#define REV(x) (reverse(x.begin(),x.end())) //reverse

ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}

ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*(b/c)*c);}

#define NEXTP(x) next_permutation(x.begin(),x.end())

const ll INF=ll(1e16)+ll(7);

const ll MOD=1000000007LL;

#define out(a) cout<<fixed<<setprecision((a))

//tie(a,b,c) = make_tuple(10,9,87);

#define pop_(a) __builtin_popcount((a))

ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}





int main(){





  ll N,ans=0;

  cin >> N;



  FOR(i,1,N+1){

    ans += i*floor((long double)N/i) * floor(1.0+(long double)N/i)/2;

  }



  cout << ans << endl;

}






// Faster C++ solution for the same problem (measured speedup: 4.4317938192105295x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define P pair<ll,ll>

#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)

#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)

#define TO(x,t,f) ((x)?(t):(f))

#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9

#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted

#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted

#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted

#define REV(x) (reverse(x.begin(),x.end())) //reverse

ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}

ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*(b/c)*c);}

#define NEXTP(x) next_permutation(x.begin(),x.end())

const ll INF=ll(1e16)+ll(7);

const ll MOD=1000000007LL;

#define out(a) cout<<fixed<<setprecision((a))

//tie(a,b,c) = make_tuple(10,9,87);

#define pop_(a) __builtin_popcount((a))

ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}





int main(){





  ll N,ans=0;

  cin >> N;



  FOR(i,1,N+1){

    ll num = N/i;

    ans += ((num+1)*num/2)*i;

  }



  cout << ans << endl;

}
// Slower C++ solution:
#include <iostream> // cout, endl, cin

#include <string> // string, to_string, stoi

#include <vector> // vector

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound

#include <utility> // pair, make_pair

#include <tuple> // tuple, make_tuple

#include <cstdint> // int64_t, int*_t

#include <cstdio> // printf

#include <map> // map

#include <queue> // queue, priority_queue

#include <set> // set

#include <stack> // stack

#include <deque> // deque

#include <unordered_map> // unordered_map

#include <unordered_set> // unordered_set

#include <bitset> // bitset

#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define _GLIBCXX_DEBUG // check []

#define DIVISOR 1000000007



using namespace std;

typedef pair<int,int> pii;

typedef pair<int64_t, int64_t> pII;



template<typename T>

void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }



#ifdef DEBUG

#define debug(fmt, ...) \

    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)

#else

#define debug(fmt, ...)

#endif



int main(void) {

    int num;

    cin >> num;

    vector<int> primes(num+1);

    for(int i = 1; i <= num; i++) {

        primes[i] = i;

    }



    vector<int> cnt(num+1, 1);

    for(int i = 2; i <= num; i++) {

        if(primes[i] == 1) continue;

        int p = primes[i];

        for(int j = i; j <= num; j+=i) {

            int m = 0;

            while(1) {

                if(primes[j]%p) break;

                primes[j] /= p;

                m++;

            }

            cnt[j] *= (m + 1);

        }

    }

    int64_t sum = 0;

    for(int i = 1; i <= num; i++) {

        sum += (int64_t)i * cnt[i];

    }

    cout << sum << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.1167022080654667x):
#include <iostream> // cout, endl, cin

#include <string> // string, to_string, stoi

#include <vector> // vector

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound

#include <utility> // pair, make_pair

#include <tuple> // tuple, make_tuple

#include <cstdint> // int64_t, int*_t

#include <cstdio> // printf

#include <map> // map

#include <queue> // queue, priority_queue

#include <set> // set

#include <stack> // stack

#include <deque> // deque

#include <unordered_map> // unordered_map

#include <unordered_set> // unordered_set

#include <bitset> // bitset

#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define _GLIBCXX_DEBUG // check []

#define DIVISOR 1000000007



using namespace std;

typedef pair<int,int> pii;

typedef pair<int64_t, int64_t> pII;



template<typename T>

void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }



#ifdef DEBUG

#define debug(fmt, ...) \

    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)

#else

#define debug(fmt, ...)

#endif



int main(void) {

    int num;

    cin >> num;

    int64_t sum = 0;

    for(int i = 1; i <= num; i++) {

        int cnt = num/i;

        sum += (int64_t)cnt * (cnt + 1) * i / 2;

    }

    cout << sum << endl;

    return 0;

}