Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03286 (python)

Fixed submission:
N=int(input())
ans=""
while N!=0:
    if N%2!=0:
        
        ans="1"+ans
        N-=1
    else:
        ans="0"+ans
    N=N/-2   
if ans=="":
    ans="0"
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
ans=""
while N!=0:
    if N%2!=0:
        
        ans="1"+ans
        N-=1
    else:
        ans="0"+ans
    N=N/-2   
if ans="":
    ans="0"
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
ans=""
while N!=0:
    if N%2!=0:
        
        ans="1"+ans
        N-=1
    else:
        ans="0"+ans
    N=N/-2
if ans="":
    ans="0"
print(ans)
Problem p03315 (python)

Fixed submission:
S=input()
sum=0
for i in range(len(S)):
    if S[i]=='+':
        sum+=1
    elif S[i]=='-':
        sum-=1
print(sum)

Buggy submission (verdict: Runtime Error):
D,N=map(int,input().split())
print(100**D*N if N<100 else 100**D*101)
Problem p03774 (python)

Fixed submission:
N,M=map(int,input().split())
a=[list(map(int,input().split())) for i in range(N)]
b=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    dmin=abs(a[i][0]-b[0][0])+abs(a[i][1]-b[0][1])
    num=1
    for j in range(M):
        dist=abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1])
        if dmin>dist:
            dmin=dist
            num=j+1
    print(num)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
S=[list(map(int,input().split())) for i in range(N)]
T=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    x1=S[i][0]
    y1=S[i][1]
    x2=T[0][0]
    y2=T[0][1]
    min=abs(x1-x2)+abs(y1-y2)
    x1=S[i][0]
    y1=S[i][1]
    for j in range(M-1,-1,-1):
        x2=T[j][0]
        y2=T[j][1]
        if min>=abs(x1-x2)+abs(y1-y2):
            min=abs(x1-x2)+abs(y1-y2)
            R[i]=j+1
for i in range(len(R)):
    print(R[i])
Problem p03803 (python)

Fixed submission:
A,B=input().split()
poker=['2','3','4','5','6','7','8','9','10','11','12','13','1']
if poker.index(A)<poker.index(B):
    print('Bob')
elif poker.index(A)>poker.index(B):
    print('Alice')
else:
    print('Draw')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[ list(input()) for i in range(N)]
B=[ list(input()) for i in range(M)]
ans='Yes'
for i in range(N-M+1):
    for j in range(N-M+1):
        
        for k in range(i,i+M):
            for l in range(j,j+M):
                if A[k][l]!=B[k-i][l-j]:
                    ans='No'
print(ans)

Buggy submission (verdict: Runtime Error):
A,B=input().split()
poker=['2','3','4','5','6','7','8','9','10','11','12','1']
if poker.index(A)<poker.index(B):
    print('Bob')
elif  poker.index(A)>poker.index(B):
    print('Alice')
else:
    print('Draw')
Problem p02989 (python)

Fixed submission:
n = input()
l = sorted([int(x) for x in raw_input().split()])
print l[n/2] - l[n/2-1]

Buggy submission (verdict: Runtime Error):
n = input()
l = sorted[int(x) for x in raw_input().split()]
print l[n/2] - l[n/2-1]
Problem p02595 (python)

Fixed submission:
Z = input("").split()
N = int(Z[0])
D = int(Z[1])
count = 0
 
while(N):
    Z1 = input("").split()
    X = int(Z1[0])
    Y = int(Z1[1])
  
    d = (X**2 + Y**2)**0.5
  
    if d<=D:
        count += 1
    N = N -1
print(count)

Buggy submission (verdict: Runtime Error):
Z = list(input(""))
N = int(Z[0])
D = int(Z[1])
count = 0
 
while(N--):
  Z1 = list(input(""))
  X = int(Z1[0])
  Y = int(Z1[1])
  
  d = (X**2 + Y**2)**0.5
  
  if d<=D:
    count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
Z = list(input(""))
N = int(Z[0])
D = int(Z[1])
count = 0

while(N--):
  Z1 = list(input(""))
  X = int(Z[0])
  Y = int(Z[1])
  
  d = (X**2 + Y**2)**0.5
  
  if d<=D:
    count += 1
    
print(count)
Problem p02622 (python)

Fixed submission:
s=input()
t=input()
ans = 0
for i in range(len(s)):
	if(s[i]!=t[i]):
		ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
ans = 0
for i in range(len(s)):
  	if(s[i]!=t[i]):
      ans+=1
print(ans)
Problem p02831 (python)

Fixed submission:
def hcf(a,b):
	if(a==0):
		return b
	if(b==0):
		return a
	return hcf(b%a,a)
import math
a,b = list(map(int,input().split()))
print(abs(a*b)//hcf(a,b))

Buggy submission (verdict: Runtime Error):
import math
a,b = list(map(int,input().split()))
print(abs(a*b)//math.gcd(a,b))

Buggy submission (verdict: Runtime Error):
import math
a,b = list(map(int,input().split()))
print(int((a*b)/math.gcd(a,b)))
Problem p03013 (python)

Fixed submission:
md = 1000000007
n,m = list(map(int,input().split()))
broken = [0 for i in range(n+1)]
dp=[0 for i in range(n+1)]
dp[0] = 1
for i in range(m):
	broken[int(input())]=1
# print(brok	en)
for j in range(1,n+1):
	if(broken[n-j]==1):
		continue
	if(j==1):
		dp[j]=1
	else:
		dp[j]=(dp[j-1]+dp[j-2])%md
# print(dp)
print(dp[n]%md)

Buggy submission (verdict: Runtime Error):
md = 1000000007
dp=[]
def countways(n,broken,ix):
	global dp,md
	if(dp[ix]!=-1):
		return dp[ix]

	ways = 0
	if((ix+1)<=n and broken[ix+1]==0):
		ways+=countways(n,broken,ix+1)
	if((ix+2)<=n and broken[ix+2]==0):
		ways+=countways(n,broken,ix+2)
	dp[ix]=(ways%md)
	return dp[ix]

n,m = list(map(int,input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(input())]=1
# print(brok	en)
print(countways(n,broken,0)%md)

Buggy submission (verdict: Runtime Error):
# import syinput = sys.stdin.readline
md = 1000000007
dp=[]
def countways(n,broken,ix):
	global dp,md
	if(dp[ix]!=-1):
		return dp[ix]

	ways = 0
	if((ix+1)<=n and broken[ix+1]==0):
		ways+=countways(n,broken,ix+1)
	if((ix+2)<=n and broken[ix+2]==0):
		ways+=countways(n,broken,ix+2)
	dp[ix]=(ways%md)
	return dp[ix]

n,m = list(map(int,input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(input())]=1
# print(brok	en)
print(countways(n,broken,0)%md)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
md = 1000000007
dp=[]
def countways(n,broken,ix):
	global dp,md
	if(dp[ix]!=-1):
		return dp[ix]

	ways = 0
	if(ix+1<=n and broken[ix+1]==0):
		ways+=countways(n,broken,ix+1)
	if(ix+2<=n and broken[ix+2]==0):
		ways+=countways(n,broken,ix+2)
	dp[ix]=(ways%md)
	return dp[ix]

n,m = list(map(int,raw_input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(raw_input())]=1
print(countways(n,broken,0)%md)

Buggy submission (verdict: Runtime Error):
mod = 1000000007
dp=[]
def countways(n,broken,index):
	global dp,mod
	if(dp[index]!=-1):
		return dp[index]

	ways = 0
	if(index+1<=n and broken[index+1]==0):
		ways+=countways(n,broken,index+1)
	if(index+2<=n and broken[index+2]==0):
		ways+=countways(n,broken,index+2)
	dp[index]=(ways%mod)
	return dp[index]

n,m = list(map(int,input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(input())]=1
print(countways(n,broken,0)%mod)

Buggy submission (verdict: Runtime Error):
mod = 1000000007
dp=[]
def countways(n,broken,index):
	global dp
	if(dp[index]!=-1):
		return dp[index]

	ways = 0
	if(index+1<=n and broken[index+1]==0):
		ways+=countways(n,broken,index+1)
	if(index+2<=n and broken[index+2]==0):
		ways+=countways(n,broken,index+2)
	dp[index]=(ways%mod)
	return dp[index]

n,m = list(map(int,input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(input())]=1
print(countways(n,broken,0)%mod)
Problem p03315 (python)

Fixed submission:
s = input()
ans = 0
for i in range(len(s)):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
s = sys.stdin.readline()
assert len(s) <= 4
ans = 0
for i in range(len(s)):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Problem p02623 (python)

Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
 
a,b = [0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
 
ans,j = 0,M
for i in range(N+1):
    if a[i]>K:
        break    
    while b[j]>K-a[i]:
        j -= 1    
    ans = max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
 
a,b = [0],[0]
for i in range(N):
    a.append(a[i]+A[i]
for i in range(M):
    b.append(b[i]+B[i])
 
ans,j = 0,M
for i in range(N+1):
    if a[i]>K:
        break    
    while b[j]>K-a[i]:
        j -= 1    
   ans = max(ans,i+j)
print(ans)
Problem p02624 (python)

Fixed submission:
n = int(input())
def g(n):
    return n * (n + 1) // 2
 
ans = 0
for i in range(1, n+1):
    ans += i * g(n // i)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
def g(n):
    return n * (n + 1) // 2
 
ans = 0
for i in range(1, n+1)
    ans += i * g(n // i)
print(ans)
Problem p02682 (python)

Fixed submission:
A, B, C, K = list(map(int, input().split( )))
     
if(K < A):
      score = K
elif(K >= A and K <= A+B):
      score = A
else:
     score = A - (K - A - B)
     
print(score)

Buggy submission (verdict: Runtime Error):
A, B, C, K = list(map(int, input().split( )))
     
  if(K < A):
    score = K
    elif(K >= A and K <= A+B):
      score = A
    else:
      score = A - (K - A - B)
     
    print(score)

Buggy submission (verdict: Runtime Error):
A, B, C, K = list(map(int, input().split( )))
     
  if(K < A):
        score = K
    elif(K >= A and K <= A+B):
        score = A
    else:
        score = A - (K - A - B)
     
    print(score)
Problem p02881 (python)

Fixed submission:
N = int(input())
search_max = int(N**0.5)
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
print(min_number-2)

Buggy submission (verdict: Runtime Error):
from math import sqrt
 
N = int(input())
 
search_max = int(sqrt(N))
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
            min_number = x + y
  print(min_number-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
search_max = int(sqrt(N))
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
print(min_number-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
search_max = int(sqrt(N))

min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
  print(min_number-2)

Buggy submission (verdict: Runtime Error):

N = int(input())
 
search_max = int(sqrt(N))
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
            min_number = x + y
 print(min_number-2)
Problem p03986 (python)

Fixed submission:
X = raw_input()
cnt = 0
cnt_max = cnt
L = len(X)

for i in range(L):
   if X[i] == 'T':
      cnt += 1
   else:
      cnt -= 1
      
   if cnt > cnt_max: 
      cnt_max = cnt

print cnt_max * 2

Buggy submission (verdict: Runtime Error):
X = raw_input()
cnt = 0
cnt_max = cnt
for i in range(len(X)):
   if X[i] = 'T':
      cnt += 1
   else:
      cnt -= 1
   if cnt > cnt_max: 
      cnt_max = cnt

print cnt_max * 2

Buggy submission (verdict: Runtime Error):
X = raw_input()
cnt = 0
cnt_max = cnt
for i in range(len(X)):
   if X[i] = 'T':
      cnt += 1
   else:
      cnt -= 1
   if cnt > cnt_max: 
        cnt_max = cnt

return cnt_max * 2
Problem p02594 (python)

Fixed submission:
xin = int(input())
	
if ( xin >= 30 ):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
xin = int(input())
	
if ( X >= 30 ):
	print("yes")
else:
	print("no")
Problem p02633 (python)

Fixed submission:
import math

x = input()
x = int(x)

lcd=(360*x)//math.gcd(360,x)

print(lcd//x)

Buggy submission (verdict: Runtime Error):
import math

x = list(map(int, input()))

print(360*x/gcd(360,x))

Buggy submission (verdict: Runtime Error):
import math

x = list(map(int, input()))

print(360*x/gcd(360,x))
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int, input().split())
print((a*b)//fractions.gcd(a,b))

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(a*b//math.gcd(a,b))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int, input().split())
print((a*b)//math.gcd(a,b))
Problem p03221 (python)

Fixed submission:
n,m=map(int,input().split())
dic=[]
ans=[]
number=[1] * (10**5+2)

for i in range(m):
    p,y=map(int,input().split())
    dic.append((p,y,i))

dic.sort(key=lambda x:x[1])

for i in range(m):
    tmp=str(dic[i][0]).zfill(6)+str(number[dic[i][0]]).zfill(6)
    number[dic[i][0]]+=1
    ans.append((tmp,dic[i][2]))

ans.sort(key=lambda x:x[1])

for i in range(m):
    print(ans[i][0])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
li=[]
city_counter = [1] * (m+1)
ans=[]

for i in range(m):
    p,y=map(int,input().split())
    li.append((p,y,i))

li.sort(key=lambda x:x[1])

for i in range(len(li)):
    tmp = str(li[i][0]).zfill(6) + str(city_counter[li[i][0]]).zfill(6)
    ans.append((tmp,li[i][2]))
    city_counter[li[i][0]] += 1

ans.sort(key=lambda x:x[1])

for i in range(len(ans)):
    print(ans[i][0])
Problem p03252 (python)

Fixed submission:
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = sorted(ss.values())
t_v = sorted(tt.values())

if s_v == t_v:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = ss.values().sorted()
t_v = tt.values().sorted()

if s_v == t_v:
    print("Yes")
else:
    print("No")
Problem p02659 (python)

Fixed submission:
A, B= input().split()
A = int(A)
B = B.replace('.','')
B = int(B)
print(A*B//100)

Buggy submission (verdict: Runtime Error):
A, B= input().split()
A = int(A)
B = float(B)
B = B * 100
C = A * B
C = math.floor (C / 100) 
print(int(C))
Problem p02711 (python)

Fixed submission:
N = input()
F = 0

for i in range(3):
    if N[i] == '7':
        F = F + 1

if F >= 1 :
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
N = int(input)

for i in range(len(N)):
    if N[i]==7:
        print('Yes')
        sys.exit()

print('No')
Problem p02659 (python)

Fixed submission:
a, b = input().split()
a = int(a)
b = int(b.replace('.', ''))
print(a * b // 100)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a * int(b * 100) // 100)
Problem p02594 (python)

Fixed submission:
X=input()
 
if int(X)>=30:
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
X=input()

if int(X)>=30:
  print('Yes')
  else :
    print('No')
Problem p02594 (python)

Fixed submission:
x = int(input())
if x >= 30:
    print('Yes')
elif x < 30:
    print('No')

Buggy submission (verdict: Runtime Error):
x = input()
if x >= 30:
    print('Yes')
elif x < 30:
    print('No')
Problem p02595 (python)

Fixed submission:
import math
N, D = map(int, input().split())
P = [list(map(int,input().split())) for i in range(N)]

cnt = 0
for i in range(N):
    d = math.sqrt(int(P[i][0])**2 + int(P[i][1])**2)
    if d <= D:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
import math
N, D = map(int, input().split())
P = [list(map(int, input().split()) for _ in range(N))]

cnt = 0
for i in range(N):
    d = math.sqrt(P[0]**2 + P[1]**2)
    if d <= D:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
import math
N, D = map(int, input().split())
P = [list(map(int, input().split()) for _ in range(N))]

cnt = 0
for i in range(N):
    d = math.sqrt(P[0]**2 + P[1]**2)
    if d <= D:
        cnt += 1
Problem p02627 (python)

Fixed submission:
x = input()
print('A') if x.isupper() else print('a')

Buggy submission (verdict: Runtime Error):
x = input()
print('A') if isupper(x) else print('a')
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = map(int, input().split())
print('OK') if (a%k ==0 or (b//k)-(a//k) >= 1) else print('NG')

Buggy submission (verdict: Runtime Error):
k = int(input())
a,b = map(int, input())
print('OK') if b-a+1 >= k else print('NG')
Problem p02753 (python)

Fixed submission:
a = input()
if a == 'AAA' or a == 'BBB':
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a = input()
if a = 'AAA' or b = 'BBB':
  print('Yes')
else:
  print('No')
Problem p02773 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import Counter
# input
n = int(input())
s = []
for i in range(n):
    s.append(input())
c = Counter(s)
# output
ma = c.most_common()[0][1]
o = [k for k, v in c.items() if v == ma]
o.sort()
print('\n'.join(o))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import Counter
# input
n = int(input())
s = []
for i in range(n):
    s.append(input())
c = Counter(s)
# output
#ma = c.most_common()[0][1]
o = list(k for k, v in s.items() if v == s.most_common()[0][1])
#o = [k for k, v in c.items() if v == ma]
o.sort()
print('\n'.join(o))
Problem p02880 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# input
b = int(input())
a = []
for i in range(9):
    for j in range(9):
        a.append((i+1)*(j+1))

if b in set(a):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# input
b = int(input())
a = []
for i in range(9):
    for j in range(9):
        a.append((i+1)*(j+1))

if b in set(a)
    print('Yes')
else:
    print('No')
Problem p03041 (python)

Fixed submission:
a, b = map(int, input().split())
s = input()
print(s[:b-1]+s[b-1:b].lower()+s[b:a])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
s = input()
print(s[:b-1]+s[b-1:b].lower()+s[b:a]
Problem p03242 (python)

Fixed submission:
a=list(input())
for i in range(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]='1'
print(a[0]+a[1]+a[2])

Buggy submission (verdict: Runtime Error):
a=list(input())
for i in RANGE(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]='1'
print(a[0]+a[1]+a[2])

Buggy submission (verdict: Runtime Error):
a=input()
for i in RANGE(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]=='1'
print(a)
Problem p03315 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# input
a = input()
o = 0
for i in range(len(a)):
    if a[i] == '+':
        o += 1
    else:
        o -= 1
print(o)

Buggy submission (verdict: Runtime Error):
a=input()
o=0
for i in range(len(a)):
  o+=1 if a[i]=='+' else o-=1
print(o)

Buggy submission (verdict: Runtime Error):
a=list(input())
o=0
for i in range(4):
  o+=1 if a[i]=='+' else o-=1
print(o)
Problem p02624 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4

#import numpy as np
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

ans=0

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

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4
 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

ans=0

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