Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    ans = 0
    for i in range(1, N+1):
        ans += sum(j for j in range(i, N+1, i))
    print(ans)
main()

Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    ans = 0
    for i in range(1, N+1):
        for j in range(i, N+1, i):
            ans += j
    print(ans)
main()

Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1, N+1):
    for j in range(i, N+1, i):
        ans += j
print(ans)


Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1, N+1):
    for j in range(1, i+1):
        if i%j==0:
            ans+=i
print(ans)


Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1, N+1):
    for j in range(1, i+1):
        if i%j==0:
            ans+=i
print(ans)


Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
for X in range(1, n+1):
  Y = n // X
  ans += Y * (Y + 1) // 2 * X
print(ans)


Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
dp = [1] * (N+1)
dp[0] =  dp[1] =  0

for i in range(2,N+1):
    if dp[i]==1:
        for j in range(i*i, N+1, i):
            dp[j] = i
#print (dp)

def factor(n):
    d = dict()
    #print(dp[n])
    while(dp[n]!=1 and dp[n]!=0):
        d[dp[n]] = d.get(dp[n],0) + 1
        n //= dp[n]
    d[n] = d.get(n,0) + 1
    return d
a = 0
for n in range(N):
    d = factor(n+1)
    ans = 1
    for k,v in d.items():
        ans *= (v+1)
    if n==0:
        ans = 1
    #print(ans,(n+1))
    a += ans*(n+1)
print (a)
    

Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
dp = [1] * (N+1)
dp[0] =  dp[1] =  0

for i in range(2,N+1):
    if dp[i]==1:
        for j in range(i*i, N+1, i):
            dp[j] = i
#print (dp)

def factor(n):
    d = dict()
    #print(dp[n])
    while(dp[n]!=1 and dp[n]!=0):
        d[dp[n]] = d.get(dp[n],0) + 1
        n //= dp[n]
    d[n] = d.get(n,0) + 1
    return d
a = 0
for n in range(N):
    d = factor(n+1)
    ans = 1
    for k,v in d.items():
        ans *= (v+1)
    if n==0:
        ans = 1
    #print(ans,(n+1))
    a += ans*(n+1)
print (a)
    

Fixed submission:
N = int(input())
ans = 0
for X in range(1, N+1):
  Y = N // X
  ans += Y * (Y + 1) // 2 * X
print(ans)