jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
// import std = require('tstl')

{
  type Print = void | string | number | string[] | number[]
  let outs: Print[] = []

  const main = (): Print => {
    const r = _io()
    const S = r.s()

    return /^(hi)+$/.exec(S) ? 'Yes' : 'No'
  }

  const _io = (i = 0) => {
    const str = require('fs').readFileSync('/dev/stdin', 'utf8')
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')

    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map(v => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  outs.push(main())

  console.log(
    outs
      .map(line => (typeof line === 'object' ? line.join(' ') : String(line)))
      .join('\n')
  )
}
//  [python]
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B,C,D = inputIL()

if A+B == C+D:
  print("Balanced")
elif A+B>C+D:
  print("Left")
else:
  print("Right")
//  [python]
import numpy as np
from collections import Counter
import collections
round = lambda x:(x*2+1)//2
a = list(map(float,input().split()))
a = np.array(a)
b = a[0]+a[1]
c = a[2] + a[3]
if b > c:
  print('Left')
elif b < c :
  print('Right')
else :
  print('Balanced')
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
A, B, C, D = ri_()
print('Balanced' if A + B == C + D else 'Left' if A + B > C + D else 'Right')
//  [java]
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		
		if (a + b == c + d) {
			System.out.println("Balanced");
		} else if (a + b > c + d) {
			System.out.println("Left");
		} else {
			System.out.println("Right");
		}
	}
}
//  [java]
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int A =Integer.parseInt(in.next());
		int B =Integer.parseInt(in.next());
		int C =Integer.parseInt(in.next());
		int D =Integer.parseInt(in.next());
		if(A+B>C+D)System.out.println("Left");
		else if(A+B<C+D)System.out.println("Right");
		else System.out.println("Balanced");
	}
}
//  [java]

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a=scanner.nextInt(), b= scanner.nextInt(), c= scanner.nextInt(), d= scanner.nextInt();
		
		int left = a+b;
		int right = c+d;
		
		String ans = "default";
		if (left<right) {
			ans = "Right";
		}else if (left==right) {
			ans = "Balanced";
		}else {
			ans = "Left";
		}
		
		System.out.println(ans);
		scanner.close();
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  string ans="Right";
  if(a+b>c+d){
    ans="Left";
  }else if(a+b==c+d){
    ans="Balanced";
  }
  cout(ans);
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int a,b,c,d;
void solve()
{
    if (a+b==c+d) cout<<"Balanced";
    else if (a+b>c+d) cout<<"Left";
    else cout<<"Right";
    cout<<endl;
}
int main()
{
    while(cin>>a>>b>>c>>d)
        solve();
}
//  [c]
#include<stdio.h>
int main()
{
    int A,B,C,D,L,R;
    scanf("%d %d %d %d",&A,&B,&C,&D);
    L=A+B;
    R=C+D;
    if(L>R)
        {printf("Left\n");}
    if(L==R)
         {printf("Balanced\n");}
    if (L<R)
         {printf("Right\n");}
    return 0;
    }
//  [c]
#include<stdio.h>
int main(){
  int a,b,c,d;
  scanf("%d%d%d%d",&a,&b,&c,&d);
  printf(a+b>c+d?"Left":(a+b<c+d?"Right":"Balanced"));
}
//  [c]
#include<stdio.h>
int  main (){
  int  a ,  b ,  c ,  d ;
  scanf ("%d%d%d%d" , &a , &b , &c , &d ) ;
  if  ( a + b>c + d) 
    printf(" Left\n " ) ;
  else if  ( a + b == c + d) 
    printf(" Balanced\n " );
  else printf (" Right\n " );
  return  0;
}
//  [javascript]
'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ');
  const a = Number(s[0]);
  const b = Number(s[1]);
  const c = Number(s[2]);
  const d = Number(s[3]);

  const left  = a + b;
  const right = c + d;

  let ans = '';
  if (left > right)   ans = 'Left';
  if (left < right)   ans = 'Right';
  if (left === right) ans = 'Balanced';

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]

// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split(" ");
	var ab = parseInt(input[0], 10) + parseInt(input[1], 10);
	var cd = parseInt(input[2], 10) + parseInt(input[3], 10);

	var result = "";
	if(ab == cd) result = "Balanced"
	else if(ab > cd) result = "Left"
	else result = "Right"

	console.log(result);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  
    var inp = input.split(" ");
    var a = parseInt(inp[0]);
    var b = parseInt(inp[1]);
    var c = parseInt(inp[2]);
    var d = parseInt(inp[3]);

    var L = a + b;
    var R = c + d;
    if ( L === R ) {
      console.log('%s', 'Balanced');
    } else if ( L > R ) {
      console.log('%s', 'Left');
    } else if ( L < R ) {
      console.log('%s', 'Right');
    }

  }
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
)

func main() {

	var A, B, C, D int
	fmt.Scan(&A, &B, &C, &D)

	if A+B > C+D {
		fmt.Print("Left")
	} else if A+B < C+D {
		fmt.Print("Right")
	} else {
		fmt.Print("Balanced")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	l := intScanner() + intScanner()
	r := intScanner() + intScanner()
	if l < r {
		fmt.Println("Right")
	} else if l == r {
		fmt.Println("Balanced")
	} else {
		fmt.Println("Left")
	}
}
//  [go]
package main

import "fmt"

func main() {
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)

	if (a + b) > (c + d) {
		fmt.Println("Left")
	} else if (a + b) < (c + d) {
		fmt.Println("Right")
	} else {
		fmt.Println("Balanced")
	}
}
//  [ruby]
a, b, c, d = gets.split.map &:to_i
if (a + b) < (c + d)
  puts :Right
elsif (a + b) > (c + d)
  puts :Left
else
  puts :Balanced
end
//  [ruby]
a,b,c,d = gets.chomp.split(" ").map(&:to_i)
if a+b < c+d
  puts "Right"
elsif a+b == c+d
  puts "Balanced"
else
  puts "Left"
end
//  [ruby]
a,b,c,d = gets.chomp.split(' ').map(&:to_i)
if a+b > c+d
  puts "Left"
elsif a+b == c+d
  puts "Balanced"
else
  puts "Right"
end
//  [rust]
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    a: usize,
    b: usize,
    c: usize,
    d: usize
    }
    let ans = if a + b == c + d {
        "Balanced"
    } else if a + b > c + d {
        "Left"
    } else {
        "Right"
    };
    println!("{}", ans);
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    let x = io.readn::<i64>(4);
    let l = x.iter().take(2).fold(0, |sm, x| sm + x);
    let r = x.iter().skip(2).take(2).fold(0, |sm, x| sm + x);
    if l == r {
        io.writeln("Balanced");
    } else if l > r {
        io.writeln("Left");
    } else {
        io.writeln("Right")
    };
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
        c: usize,
        d: usize,
    }

    if a+b>c+d {
        println!("Left");
    } else if a+b==c+d {
        println!("Balanced");
    } else {
        println!("Right");
    }

}
//  [swift]
import Foundation

var line: String

line = readLine()!

var nums: [Int] = Array<Int>()
for num in line.componentsSeparatedByString(" ") {
	nums.append(Int(num)!)
}

if nums[0] + nums[1] < nums[2] + nums[3] {
	print("Right")
}else if nums[0] + nums[1] > nums[2] + nums[3] {
	print("Left")
}else{
	print("Balanced")
}
//  [swift]
let input = readLine()!
    .split(separator: " ")
    .compactMap { Int($0) }

let left = input[0] + input[1]
let right = input[2] + input[3]

if left > right {
    print("Left")
} else if left < right {
    print("Right")
} else {
    print("Balanced")
}
//  [typescript]
namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length === 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function slove() {
    const sc = new Scanner();
    const [A, B, C, D]: number[] = (await sc.getLine())
      .split(' ')
      .map((x) => +x);
    const t = A + B;
    const s = C + D;
    if (t > s) {
      console.log('Left');
    } else if (t === s) {
      console.log('Balanced');
    } else {
      console.log('Right');
    }
    sc.close();
  }

  slove();
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B, C, D] = input[0].map(Number);

  const L = A + B;
  const R = C + D;

  return L === R ? "Balanced" : L > R ? "Left" : "Right";
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc083 {
    export class Program {
        constructor(private readonly args: string[][]) {

        }

        main(this: Program) {
            const [a, b, c, d]: number[] = this.args[0].map(Number);

            if (a + b > c + d) console.log('Left');
            if (a + b < c + d) console.log('Right');
            if (a + b === c + d) console.log('Balanced');

        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
const prg: AtCoder.abc083.Program = new AtCoder.abc083.Program(args);
prg.main();
//  [python]
N = int(input())

s=k=0;n=N
while k<n:
	k += 1
	n = N//k
	s += k*n*(n+1)
knn = k*n*(n+1)//2
s -= (k+1)*knn//2
if n<k:
	s -= knn

print(s)
//  [python]
def F(N): 
    r = int(N**0.5) # x >= 10^9 のときは注意
    ans = 0
    for d in range(1,N//r+1):
        ans += d*(1+(N//d))*(N//d)//2

    #print(ans)    
    for c in range(1,r):
        a = N//(c+1)
        b = N//c
        """
        (a,b] 上で d の和を求める
        """
        s = b*(b+1)//2-a*(a+1)//2
        ans += s*(c*c+c)//2
        #ans %= MOD
    return ans


# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n, = map(int,readline().split())
print(F(n))
//  [python]
#!/usr/bin/env python3


def main():
    n = int(input())
    ans = n * (n + 1) - 1  # 1とk 自信

    i = 2
    while i * i <= n:
        num = n // i
        min_i = i * i
        max_i = i * num
        ans += (num - i + 1) * (min_i + max_i)  # 自分自身
        ans -= min_i
        i += 1
    print(ans)


if __name__ == "__main__":
    main()
//  [python]
from sys import stdin
from sys import setrecursionlimit

n = int(input())
ans = 0

for i in range(1,n+1):
    ma = i*(n//i)
    ans += (n//i)*(ma+i)//2

print(ans)
//  [python]
N = int(input())
ans = 0
for i in range(1,N+1):
  Limit = N//i
  ans += int(Limit*(Limit+1)*i/2)
print(ans)
//  [python]
N = int(input())
goukei = 0
for i in range(1,N+1):
    k = N//i
    goukei += int(i*k*(k+1)//2)
print(goukei)
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AnandOza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DSumOfDivisors solver = new DSumOfDivisors();
        solver.solve(1, in, out);
        out.close();
    }

    static class DSumOfDivisors {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();

            long answer = 0;
            for (int i = 1; i <= n; i++) {
                long first = i;
                long last = (n / i) * i;
                long count = n / i;

                long sum = (first + last) * count / 2;
                answer += sum;
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        long ans = 0;
        List<Long> num = new ArrayList<>();
        for (int i = 0; i <= n; i++) {
            num.add(0L);
        }
        for (int i = 2; i <= n; i++) {
            for (int j = 1; i * j <= n; j++) {
                long temp = num.get((int)i * j);
                num.set((int)i * j, temp + 1);
            }
        }
        for (int i = 2; i <= n; i++) {
            ans += (num.get(i) + 1) * i;
        }
        System.out.println(ans + 1);
    }
}
//  [java]
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	
	static final int MAXN = 10000001; 
    
    static int spf[] = new int[MAXN]; 
	
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
	
		sieve();
		
		int n=s.nextInt();
		
		long ans=0;
		
		for(int i=1;i<=n;i++)
		{
			HashMap<Integer,Long> map=new HashMap<>();
			
			int temp=i;
			
			while(temp>1)
			{
				
				if(map.containsKey(spf[temp]))
				{
					map.put(spf[temp],map.get(spf[temp])+1);
				}
				else
				{
					map.put(spf[temp],1l);
				}
				
				temp=temp/spf[temp];
			}
			
			long count=1;
			
			for(Map.Entry<Integer,Long> entry:map.entrySet())
			{
				count=count*(entry.getValue()+1);
			}
			
			ans=ans+(i*count);
		}
		
		System.out.println(ans);
		
	}
	
	public static void sieve() 
    { 
        spf[1] = 1; 
        for (int i=2; i<MAXN; i++) 
       
            // marking smallest prime factor for every 
            // number to be itself. 
            spf[i] = i; 
       
        // separately marking spf for every even 
        // number as 2 
        for (int i=4; i<MAXN; i+=2) 
            spf[i] = 2; 
       
        for (int i=3; i*i<MAXN; i++) 
        { 
            // checking if i is prime 
            if (spf[i] == i) 
            { 
                // marking SPF for all numbers divisible by i 
                for (int j=i*i; j<MAXN; j+=i) 
       
                    // marking spf[j] if it is not  
                    // previously marked 
                    if (spf[j]==j) 
                        spf[j] = i; 
            } 
        } 
    } 
	
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        int N = ni();
        int[] d = new int[N+1];
        d[1] = 1;
        d[0] = -1;
        for (int i = 2; i <= N; i++) {
            if(d[i] != 0) continue;
            d[i] = i;
            for (int j = i+i; j <= N; j+=i) {
                if(d[j] == 0) d[j] = i;
            }
        }
        long ans =0;
        for (int i = 1; i <=N; i++) {
            HashMap<Integer,Integer> res = new HashMap<>();
            int k = i;
            while(k!=1){
                res.putIfAbsent(d[k],0);
                res.put(d[k],res.get(d[k])+1);
                k /= d[k];
            }
            // System.out.println(res);
            long count = 1;
            for (Integer j : res.values()) {
                count *= (j+1);
            }
            // System.out.println(count);
            ans += i*count;
        }
        out.println(ans);
    }

 
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}
//  [cpp]
#include <stdio.h>
using namespace std;
int N;
int i = 2;
int num, min_i;
long long max_i;
int main()
{

  scanf("%d", &N);
  long long ans = (long long)N * (N + 1) - 1;

  while (i * i <= N)
  {
    num = N / i;
    min_i = i * i;
    max_i = i * num;
    ans += (num - i + 1) * (min_i + max_i);
    ans -= min_i;
    i += 1;
  }
  printf("%lld", ans);
}
//  [cpp]
#include <stdio.h>
using namespace std;
int N;
int i = 2;
int num;
int main()
{

  scanf("%d", &N);
  long long ans = (long long)N * (N + 1) - 1;

  while (i * i <= N)
  {
    num = N / i;
    ans += (long long)(num - i + 1) * i * (i + num) - i * i;
    i += 1;
  }
  printf("%lld", ans);
}
//  [cpp]
  //shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll n;
  cin >> n;
  ll xx = (ll)sqrt(n);
  ll ans = 0;
  ll dd = (xx)*(xx+1)*(2*xx + 1);
  dd/=6;
  for(ll i = 1; i <= xx; i++) {
  	ll pp = (i*(i + (n/i))*((n/i) + 1 - i));
  	ans+=pp;
  }
  cout << ans - dd << endl;
  return 0;
} //good night.
//  [cpp]
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ff first
#define ss second
#define pb push_back
#define Inf  1e18
#define inf -1e18
#define mod 1000000007
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll,ll>;
using umll = unordered_map<ll,ll>;
using sll = set<ll>;
using msll = multiset<ll>;
using pll = pair<ll,ll>;
 
ll MUL(ll A,ll B){
  return (A%mod*B%mod)%mod;
}
 
ll ADD(ll A,ll B){
  return (A%mod+B%mod)%mod;
}
 
ull power(ll A,ll B) {
    ull RES = 1;
    while (B > 0)
    {
        if (B & 1)
            RES = RES*A;
        B = B>>1;
        A = A*A;
    }
  return RES;
}
 
 const ll MAXN = 1e7+5;
 int spf[MAXN];

 
 
 
 void sieve() 
{ 
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++)  
        spf[i] = i; 
    for (int i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (int i=3; i*i<MAXN; i++) 
    {  
        if (spf[i] == i) 
        {  
            for (int j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 

unordered_map<ll,ll> getFactorization(ll x) 
{ 
    unordered_map<ll,ll> MAP; 
    while (x != 1) 
    { 
        MAP[spf[x]]++;
        x = x / spf[x]; 
    } 
    return MAP; 
} 

void testcases(int cases){
	ll n;
	cin >> n ;
	ll ans = 1;
	ll sum = 0;
	for(int i = 1 ;i <= n ; i ++){
			unordered_map<ll,ll> M = getFactorization(i);
			ans = 1;
			for(auto it :M){
				ans = ans*(it.ss+1);
			}
			sum = sum + ans*i ;
	}
	cout << sum << "\n";
}
int main()
{
	sieve();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
    ll t;
    t = 1;
    //t = 1;
    ll Case =1 ;
    while(t--)
    {
      testcases(Case++);
    }
}
//  [cpp]
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
#pragma GCC optimize("Os")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin>>
#define OUT cout<<
#define loop(i,a,n) for(ll i=a; i<n; i++)
#define rloop(i,a,n) for(int i=a; i>=n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
using namespace std;
ll gcd(ll a, ll b)
{
    return (b?gcd(b,a%b):a);
}
ll P(ll B, ll power, ll modulo)
{
    ll ans=1LL;
    while(power>0LL)
    {
        if(power%2LL==1LL)
        {
            ans=(ans*B)%modulo;
        }
        B=(B*B)%modulo;
        power/=2LL;
    }
    return ans;
}
bool isPrime(ll n)
{
    if(n<=1LL)
    {
        return false;
    }
    if(n<=3LL)
    {
        return true;
    }
    if(n%2==0LL || n%3==0LL)
    {
        return false;
    }
    for(ll i=5LL; (i*i)<=n; i+=6LL)
    {
        if(n%i==0LL || n%(i+2LL)==0LL)
        {
            return false;
        }
    }
    return true;
}
void vok()
{
    FAST
    FO
    FI
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        freopen("error.txt","w",stderr);
    #endif
}
const int mxN=int(1e7)+1;
int spf[mxN]; 
void sieve() 
{ 
    spf[1]=1; 
    loop(i,2,mxN)
    {
        spf[i]=i; 
    }
    for(int i=4; i<mxN; i+=2) 
    {
        spf[i]=2; 
    }
    for(int i=3; (i*i)<mxN; i++) 
    { 
        if(spf[i]==i) 
        {  
            for(int j=i*i; j<mxN; j+=i) 
            {
                if(spf[j]==j)
                { 
                    spf[j]=i; 
                }
            }
        } 
    } 
} 
ll divs(int x)
{
    ll res=1LL;
    unordered_map<int,int> countt;
    while(x!=1) 
    { 
        countt[spf[x]]++;
        x/=spf[x]; 
    } 
    for(auto y:countt)
    {
        res*=((ll)y.second+1LL);
    }
    return res;
}
int main()
{
    vok();
    sieve();
    int n;
    IN n;
    ll ans=0LL;
    loop(i,1,n+1)
    {
      	ll temp=divs(i);
        ll add=(ll)(i)*temp;
        ans+=add;
    }
    OUT ans<<endl
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int INF = 0x3f3f3f3f;
const ll inf = 0x3f3f3f3f3f3f3f3f;
const ll mod = 1e9 + 7;
const int N = 1e7 + 10;
int n;
ll f[N];
int prime[N];
bool is_prime[N];
int sieve(int n) {
	int p = 0;
	memset(is_prime, true, sizeof(is_prime));
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i <= n; i++) {
		if (is_prime[i]) {
			prime[p++] = i;
			for (int j = 2 * i; j <= n; j += i) {
				is_prime[j] = false;
			}
		}
	}
	return p;
}
ll ans;
int main() {
	scanf("%d", &n);
	int p = sieve(n);
	f[1] = 1;
	ans = 1;
	for (int i = 2; i <= n; i++) {
		int t = i;
		for (int j = 0; j < p && 1ll * prime[j] * prime[j] <= t; j++) {
			if (t%prime[j] != 0)continue;
			int cnt = 0;
			while (t%prime[j] == 0) {
				cnt++;
				t /= prime[j];
			}
			f[i] *= (cnt + 1);
			f[i] += cnt;
		}
		if (t != 1)f[i] *= 2, f[i]++;
		ans += 1ll * i*(f[i]+1);
	}
	printf("%lld\n", ans);
	return 0;
}
//  [c]
#include <stdio.h>
#include <math.h>
// using namespace std;
int N;
int i = 2;
int num;
char buf[8], out[20];
char k;
s;
size_t ii;
int main()
{
  s = read(0, buf, 8);
  for (;;)

  {
    k = buf[ii++];
    if (k < '0')
      break;
    N = N * 10 + k - '0';
  }
  // printf("%d\n", N);
  long long ans = (long long)N * (N + 1) - 1;

  for (; i * i <= N; i++)
  {
    num = N / i;
    // ans += (long long)(num - i + 1) * i * (i + num) - i * i;
    ans += (long long)i * ((long long)num * num - i * i + num);
  }
  printf("%lld\n", ans);
}
//  [c]
#include <math.h>
#include <stdio.h>
int n, sqrtN;
long long ans, d;
char buf[8],out[20];
char k;
s;
size_t i;
int main() {
    s = read(0, buf, 8);
    for(;;) {
        k = buf[i++];
        if(k < '0') break;
        n = n * 10 + k - '0';
    }
    if(n == 1) {
        putchar(49);
    } else {
        const int sqrtN = sqrt(n);
        ans = -(long long)(sqrtN) * (sqrtN + 1) * (2 * sqrtN + 1) / 6;
        for(int i = 1; i <= sqrtN; ++i) {
            const int a = n / i;
            ans += ((long long)i * (i + a) * (a + 1 - i));
        }
        i = 20;
        do{
            out[--i]=ans%10+'0';
            ans/=10;
        }while(ans);
        write(1,out+i,20-i);
    }
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) ((a)>0 ?(a):-(a))
#define llong long long

int main(){
	llong f[10000001]={0,1,2};
	llong p[5000001]={2};	// 素数列
	int p_num=1;	// 見つかった素数の数
	int N; scanf("%d",&N);
	if( N==1 ){ printf("1"); return 0; }
	if( N==2 ){ printf("5"); return 0; }
	N++;
	rep(i,3,N) f[i]=1;
	llong ans=5;
	rep(i,3,N){
		int k=i;
		int i_2 = sqrt(i)+1;
		rep(j,0,p_num){
			if( p[j]>i_2 ) break;
			if( k%p[j]==0 ){
				int cnt=1;
				while( k%p[j]==0 ){
					cnt++;
					k /= p[j];
				}
				f[i] = cnt*f[k];
				break;
			}
		}
		if( f[i]==1 ){
			f[i]=2;
			if( i*i<N ){
				p[p_num]=i; p_num++;
			}
		}
		ans += i*f[i];
	}
	printf("%lld",ans);
	return 0;
}
//  [c]
#include<stdio.h>
int main(){
  long int p[10000001],e[10000001]={0},f[10000001],i,j,k=0,n,r=1,l,m;
  scanf("%ld",&n);
  for(i=0;i<=n;i++)f[i]=1;
  for(i=2;i<=n;i++)if(!e[i]){p[k]=i;k++;for(j=i;j<=n;j+=i)e[j]=1;}
  for(i=0;i<k;i++)for(j=p[i];j<=n;j+=p[i]){l=1;m=j;while(m%p[i]==0){l++;m/=p[i];}f[j]*=l;}
  for(i=2;i<=n;i++)r+=f[i]*i;
  printf("%ld",r);
}
//  [javascript]
const N = require("fs").readFileSync("/dev/stdin", "utf8") - 0
let s = 0
for (let i = 1; i <= N; i++) {
    const n = Math.floor(N / i)
    s += (n * n + n) / 2 * i
}
console.log(s)
//  [javascript]
var fs = require("fs");
var line = fs.readFileSync("/dev/stdin");
var N = Number(line);
var res = 0;

for (let i = 1; i <= N; i++) {
  const n = Math.floor(N / i);
  res += (i * n * (n + 1)) / 2;
}

console.log(res);
//  [javascript]
const fs = require("fs");
const line = fs.readFileSync("/dev/stdin");
const N = Number(line);
let res = 0;

for (let i = 1; i <= N; i++) {
  const n = Math.floor(N / i);
  res += (i * n * (n + 1)) / 2;
}

console.log(res);
//  [javascript]
console.log((args=>{
  const N = args|0;
  const e = Array(N+1).fill(1);
  e[0] = 0;
  for ( let i = 2; i <= N; i++ ) {
    for ( let j = i; j <= N; j+=i ) {
      e[j]++;
    }
  }
  return `${e.reduce((a,b,i)=>a+b*i)}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
//  [javascript]

let input = require("fs").readFileSync("/dev/stdin", "utf8")

function main() {
    const [N] = load()
    
    const divisors = new Array(N+1).fill(0)
    for(let i = 1; i <= N; i++) {
        for(let j = 1; j <= N; j++) {
            const val = i * j
            if(val > N) break
            divisors[val]++
        }
    }

    let result = 0
    for(let i = 1; i <= N; i++) {
        result += i * divisors[i]
    }

    return result
}


let inputs = input.split(/[\s\n]/)
console.log(main())


// 入力値を読み込む
function load(rows = 1, cols = 1, type = Number) {
    const length = rows * cols
    let result = inputs.splice(0, length)

    if(type !== String) result = result.map(type)
    if(cols > 1) {
        const arrays = new Array(cols)
        for(let col = 0; col < cols; col++) {
            arrays[col] = new Array()
            for(let row = 0; row < rows; row++) {
                arrays[col].push(result[row * cols + col])
            }
        }
        result = arrays
    }

    return result
}
//  [javascript]
'use strict';

function Main(input) {
    const N = Number(input.trim().split('\n')[0]);

    let divisors = new Array(N + 1).fill(0);

    for (let i = 1; i <= N; i++) {
        for (let j = i; j <= N; j += i) {
            divisors[j]++;
        }
    }

    // console.log(divisors);
    let result = divisors.reduce((sum, v, i) => sum + v * i);

    console.log(String(result));
    

    return;
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	. "fmt"
	"math"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	n:=0
	Scan(&n)
	m := int(math.Sqrt(float64(n)) + 1e-8)
	s := -m * (m + 1) * (2*m + 1) / 6
	for i := 1; i <= m; i++ {
		s += i * (i + n/i) * (n/i + 1 - i)
	}
	Print(s)
}
//  [go]
package main
import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
)

func Solve() {
  var N, d int
  NextInt(&N)
  ans := 0
  for k := 1; k <= N; k++ {
    d = N / k
    if d > 1 {
      ans += k * d * (d + 1) / 2
    } else {
      ans += (N - k) * (N - k + 1) / 2 + k * (N - k + 1)
      break
    }
  }
  Write(ans)
}

func main() {
  Solve()
  Output()
}

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntSlice(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatSlice(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(S ...interface{}) {
  fmt.Fprintln(writer, S...)
}
func WriteIntSlice(A []int) {
  B := make([]interface{}, len(A))
  for i, a := range A { B[i] = a }
  Write(B...)
}
func Output() {
  _ = writer.Flush()
}
func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
  	var ans int64
  	ans = 1
	for i := 2; i < n+1; i++ {
      	ans += int64(i)
		for j := i; j < n+1; j += i {
			ans += int64(j)
		}
	}
	fmt.Fprintln(writer, ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int64 {
	sc.Scan()
	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

type cnt struct {
	v int64
	c int64
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a := make([]cnt, n+10)
	for i := int64(2); i <= n; i++ {
		if a[i].v == 1 {
			continue
		}
		for j := i; j <= n; j += i {
			if a[j].v == 0 {
				a[j].v = j
				a[j].c = 1
			}

			c := int64(0)
			for a[j].v%i == 0 {
				a[j].v /= i
				c++
			}
			a[j].c *= (c + 1)
		}
	}
	res := int64(1)
	for i := int64(2); i <= n; i++ {
		res += i * a[i].c
	}
	fmt.Println(res)
}
//  [ruby]
N = gets.to_i

s=k=0;n=N
while k<n
	k += 1
	n = N/k
	s += k*n*(n+1)
end
knn = k*n*(n+1)/2
s -= (k+1)*knn/2
s -= knn if n<k

p s
//  [ruby]
N = gets.to_i

ans = 0
1.step((N**0.5).to_i+1) do |k|
  break if N < k*k
  n = (N + k - k*k) / k
  ans += n * (2*k*k + (n-1)*k) - k*k
end
puts ans
//  [ruby]
N = gets.to_i

s=k=kn=0;n=N
while k<n
	k += 1
	n = N/k
	kn = k*n*(n+1)
	s += 4*kn
end
s -= (k+1)*kn
s -= 2*kn if n<k

p s/4
//  [ruby]
def f(k)
  n = (N + k - k) / k
  n * (2*k + (n-1) * k) / 2
end

N = gets.to_i
puts 1.step(N).sum(&method(:f))
//  [ruby]
n = gets.chomp.to_i
puts (1..n).to_a.inject(0) { |acc, i| acc + (i + (n / i) * i) * (n / i) / 2 }
//  [ruby]
N = gets.to_i
sum = 0
for i in 1..N
  a = i
  d = i
  n = N/i
  sum += (n.to_f/2)*(2*a + (n-1)*d)
end
p sum.floor
//  [rust]
fn main() {
    proconio::input! {
        n:usize
    }
    let mut ans = 0;
    //    let mut i = 1;
    let s = (n as f64).sqrt() as usize;
    let mut i = 1;
    while i * i <= n {
        let c = n / i;
        ans += i * c * (c + 1) / 2;
        // さらに、c について、いくつかまとめて計算。
        if c > i {
            let d = n / (i + 1);
            ans += (c * (c + 1) - d * (d + 1)) * i * (i + 1) / 4;
        }
        i += 1;
    }
    println!("{}", ans);
}
//  [rust]
fn run() {
    proconio::input! {
        n: u64,
    }
    let mut ans = 0;
    let mut i = 1;
    while i * i <= n {
        let p = n / i;
        ans += i * p * (p + 1) * 2;
        i += 1;
    }
    i = n / i;
    let mut prev = n / (i + 1);
    while i > 0 {
        let x = n / i;
        let y = prev;
        prev = x;
        ans += i * (i + 1) * (x * (x + 1) - y * (y + 1));
        i -= 1;
    }
    ans >>= 2;
    println!("{}", ans);
}

fn main() {
    run();
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
    }

    if n == 1 {
        println!("1");
        return;
    }

    let mut divisor_num = vec![0; n + 1];
    divisor_num[1] = 1;
    divisor_num[2] = 2;
    let mut primer = vec![2];

    for i in 3..n + 1 {
        let mut target = i;
        let mut is_prime = true;
        let mut divide_num = 0;

        for p in primer.iter() {
            if p * p > target {
                break;
            }
            while target % p == 0 {
                target /= p;
                divide_num += 1;
            }
            if divide_num > 0 {
                is_prime = false;
                break;
            }
        }
        if is_prime {
            divisor_num[i] = 2;
            primer.push(i);
        } else {
            divisor_num[i] = (divide_num + 1) * divisor_num[target];
        }
    }

    let mut sum: i64 = 0;
    for i in 1..n + 1 {
        sum += i as i64 * divisor_num[i] as i64;
    }

    println!("{}", sum);
}

// 約数の数が2でnより小さい数 素数で割る
// 割れないなら次の素数を試す
// どれでも割れなかったら素数なので約数の数は２
// 割り切れたら、割った回数をmとして、割った結果の約数*(m+1)が約数の数