stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

typedef long long LL;



using namespace std;

int main(){

	int N,T,t;

	while(cin>>N>>T){

		LL ans = T,x=0;

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

			cin>>t;

			if(t-x<T)

				ans+=t-x;

			else ans+=T;

			x = t;

		}	

		cout<<ans<<endl;

	}



	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<cmath>

#include<string>

#include<cstdlib>

#include<algorithm>

using namespace std;



const int MaxN = 2e5;

long long a[MaxN + 5];

int N;

long long T, x;



int main()

{

	long long flag = 0;

	scanf("%d %lld", &N, &T);

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

		scanf("%lld", &a[i]);

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

		{

			if(a[i] <= T)

			{

				flag = a[i];

				x = a[i];

			}

			else if(a[i] - a[i - 1] > T)

				x += T;

			else

				x += a[i] - a[i - 1];

		}

		printf("%lld\n", x + T);

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<iostream>

#include<map>

#include<queue>

using namespace std;



int main(){

	int a[200005];

	int n,t,i,T=0;

	scanf("%d%d",&n,&t);

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

		scanf("%d",&a[i]);

	}

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

		if((a[i]-a[i-1])>=t) T=T+t;

		if((a[i]-a[i-1])<t) T=T+(a[i]-a[i-1]);   	   

	}

	T=T+t;

	printf("%d\n",T);

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<cmath>

#include<string>

#include<cstdlib>

#include<algorithm>

using namespace std;



const int MaxN = 2e5;

long long a[MaxN + 5];

int N;

long long T, x;



int main()

{

	long long flag = 0;

	scanf("%d %lld", &N, &T);

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

		scanf("%lld", &a[i]);

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

		{

			if(a[i] <= T)

			{

				flag = a[i];

				x = a[i];

			}

			else if(a[i] - a[i - 1] > T)

				x += T;

			else

				x += a[i] - a[i - 1];

		}

		printf("%lld\n", x + T);

		return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



int ri() {

	int n;

	scanf("%d", &n);

	return n;

}



int main() {

	int n = ri();

	int cnt[n + 1];

	memset(cnt, 0, sizeof(cnt));

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

		for (int j = i; j <= n; j += i) cnt[j]++;

	}

	int64_t res = 0;

	for (int i = 0; i <= n; i++) res += (int64_t) i * cnt[i];

	printf("%" PRId64 "\n", res);

	return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



int ri() {

	int n;

	scanf("%d", &n);

	return n;

}

// O(sqrt(N))



int main() {

	int n = ri();

	int m = sqrt(n);

	auto calc = [&] (int n) { // sum [1, n]

		return (int64_t) n * (n + 1) / 2;

	};

	int64_t res = 0;

	for (int i = 1; i <= m; i++) res += i * calc(n / i);

	for (int i = 1; i <= m; i++) res += (calc(n / i) - calc(std::max(m, n / (i + 1)))) * calc(i);

	printf("%" PRId64 "\n", res);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

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

#define ALL(v)   (v).begin(),(v).end()

#define debug(x) cerr<<#x<<": "<<(x)<<endl

#define INF      (int)1e9

#define EPS      (double)1e-9

#define MOD      ((int)1e9+7)

using namespace std;

typedef long long     llong;

typedef vector<int>   vi;

typedef vector<vi >   vvi;

typedef vector<vvi >  vvvi;

typedef pair<int,int> pii;

template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}



int main(){

	int n;

	cin>>n;

	

	vi dp(n+1,1);

	bool jud[n+1]={};

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

		if(jud[i]){}

		else{

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

				int cnt=0;

				int tmp=j;

				while(tmp%i==0){

					tmp/=i;

					cnt++;

				}

				dp[j]*=cnt+1;

				jud[j]=true;

			}

		}

	}

	

	llong ans=0;

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

		ans+=i*dp[i];

	}

	

	cout<<ans<<endl;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

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

#define ALL(v)   (v).begin(),(v).end()

#define debug(x) cerr<<#x<<": "<<(x)<<endl

#define INF      (int)1e9

#define EPS      (double)1e-9

#define MOD      ((int)1e9+7)

using namespace std;

typedef long long     llong;

typedef vector<int>   vi;

typedef vector<vi >   vvi;

typedef vector<vvi >  vvvi;

typedef pair<int,int> pii;

template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}



//解説参考.

int main(){

	int n;

	cin>>n;

	

	llong ans=0;

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

		llong tmp=n/i;

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

	}

	

	cout<<ans<<endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;  

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}






// Optimized solution to the same problem (faster):
#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;

}






// Fastest known solution for this problem: