peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N,M = map(int,readline().split())

c = [1]*N
r = [0]*N
r[0] = 1

for _ in range(M):
    x,y = map(int,readline().split())
    x,y = x-1,y-1
    if r[x]:
        if c[x] == 1:
            r[x] = 0
        r[y] = 1
    c[x] -= 1
    c[y] += 1

print(sum(r))
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]
m1 = 0
m2 = 0
mp = 0
for i in range(n):
    if (m1 < a[i]):
        m2 = m1
        m1 = a[i]
        mp = i
    elif (m2 < a[i]):
        m2 = a[i]
#print(m1,m2,mp)
for i in range(n):
    if (mp == i):
        print(m2)
    else:
        print(m1)
# Judge status: Wrong Answer
N = input()

if "9" in N:
        print( "YES" )
else:
    print( "NO" )
# Judge status: Accepted
import sys
input = sys.stdin.readline


n = int(input())

a = []
b = []

for i in range(n):
    aa,bb = map(int,input().split())
    a.append(aa)
    b.append(bb)

s = 0
res = 0
for i in range(n-1,-1,-1):
    a[i] += res

    if a[i]%b[i] == 0:
        continue
    
    res += b[i]-(a[i]%b[i])
print(res)
# Judge status: Accepted
N = int(input())
S = []
for i in range(N):
  S.append(input())
T = []
M = int(input())
for j in range(M):
  T.append(input())

C = []  
for i in range(N):
  count = 0
  for j in range(N):
    if S[i] == S[j]:
      count = count + 1
  for k in range(M):
    if S[i] == T[k]:
      count = count -1
  C.append(count)

print(max(0,(max(C))))
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
#入力
n,k = map(int,input().split())

if (500*n > k):
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
n , m = map(int, input().split())
id =[]
ch = 1
for i in range(m):
    p , y = input().split()
    p = p.zfill(6)
    id.append([p,y,i])
id.sort(key = lambda x:x[1])
id.sort(key = lambda x:x[0])
id.append(['X','X','X'])
for i in range(m):
    id[i][1]=str(ch).zfill(6)
    if id[i][0]==id[i+1][0]:
        ch+=1
    else:
        ch=1
id.pop()
id.sort(key = lambda x:x[2])
for i in range(m):
    s = id[i][0]+id[i][1]
    print(s)
# Judge status: Accepted
N, A, B = map(int, input().split())
print(sum(x for x in range(1, N+1) if A<=sum((map(int, str(x))))<=B))
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for _ in range(n)]

ans = 0

for i in range(n):
    if i == 0:
        now = a[0]-1
        ans += 1
    else:
        now = a[now]-1
        ans += 1
    if now == 1:
        print(ans)
        break
    if i == n:
        print(-1)
# Judge status: Accepted
N=input()
NL=len(N)
if N[1:]=='9'*(NL-1):
  ans=int(N[0])+9*(NL-1)
else:
  ans=int(N[0])+9*(NL-1)-1
print(ans)
# Judge status: Accepted
n = int(input())
m = n//3
mod = 10**9+7

dp = [[0]*n for _ in range(m)]

for i in range(2, n):
    dp[0][i] = 1

for i in range(1, m):
    for j in range(3, n):
        dp[i][j] = dp[i-1][j-3] + dp[i][j-1]

ans = 0
for i in range(m):
    ans += dp[i][-1]
    ans %= mod
print(ans)
# Judge status: Wrong Answer
S = input()
odd = S[0::2]
even = S[1::2]
ans = 'No'

if odd not in 'L':
    if even not in 'R':
        ans = 'Yes'

print(ans)
# Judge status: Wrong Answer
x,y,z = map(int,input().split())
count = 0
t = 0

for i in range(10**6):
  t += y
  if t<=x:
    count += 1
  else:
    exit()
  t += z
  
print(count)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
S=sum(A)
T=[0]*N
for i in range(N-1):
    T[i+1]=T[i]+A[i]
print(min(abs(S-2*T[i]) for i in range(1,N)))
# Judge status: Wrong Answer
N, M = map(int, input().split())
ABs = [input().split() for i in range(M)]


MPs = {}
for a, b in sorted(ABs, key=lambda i: i[1]):
    if a not in MPs:
        MPs[a] = 1
    else:
        MPs[a] += 1
    if b not in MPs:
        MPs[b] = 1
    else:
        MPs[b] += 1


for x, y in sorted(MPs.items(), key=lambda j: j[0]):
    print(y)
# Judge status: Accepted
x=eval(input().replace(' ','+'));print(x%24)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

while True:
  c -= b
  if c <= 0:
    print('Yes')
    break
    
  a -= d
  if a <= 0:
    print('No')
    break
# Judge status: Wrong Answer
if __name__ == '__main__':
    n,a,b = map(int, input().split())
    minN = a+ b+ (n-2)*a
    maxN = a+ b+ (n-2)*b
    print(maxN-minN+1)
# Judge status: Wrong Answer
#B - Nice Shopping 
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
X = []
Y = []
C = []
for i in range(M):
    x,y,c = map(int,input().split())
    X.append(x)
    Y.append(y)
    C.append(c)

#割引券を使う場合
best_M_idx = C.index(max(C))
pay_M = a[X[best_M_idx]-1] + b[Y[best_M_idx]-1]-max(C)
#使わない場合
pay = min(a) + min(b)
print(min(pay,pay_M))
# Judge status: Wrong Answer
import numpy as np
n = int(input())
a = list(map(int, input().split()))
p = 7 + 10**9


b = [tuple(map(int, format(i, "061b"))) for i in a]
bits1 = np.array(b)
bits0 = bits1 ^ 1

accum1 = np.add.accumulate(bits1[::-1])[::-1]
accum0 = np.add.accumulate((bits0)[::-1])[::-1]

sum1 = bits1[:-1] * accum0[1:]
sum0 = bits0[:-1] * accum1[1:]

sumall = np.sum(sum1, axis=0) + np.sum(sum0, axis=0)
ans = sumall * (2 ** np.array(list(range(61)), np.int64))[::-1] % p

print(np.sum(ans) % p)
# Judge status: Accepted
from collections import deque

s = list(input())
q = int(input())
t = [list(map(str,input().split())) for _ in range(q)]

d = deque(s)

cnt = 0
for i in range(q):
  if len(t[i]) == 1:
    cnt += 1
  else:
    if (int(t[i][1])+cnt) % 2 != 0:
      d.appendleft(t[i][2])
    else:
      d.append(t[i][2])
      
if cnt%2 != 0:
  d = list(d)[::-1]
print(''.join(d))
# Judge status: Accepted
n = list(map(int, list(input())))
ans = len(n)*9 - (9 - n[0]) -1
print(max(ans, sum(n)))
# Judge status: Accepted
from functools import reduce
from math import ceil

n, h = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort(key=lambda x: x[0], reverse=True)
max_a = ab[0][0]
ab = list(filter(lambda x: x[1] >= max_a, ab))

ab.sort(key=lambda x: x[1], reverse=True)
for i, v in enumerate(ab):
    h -= v[1]
    if h <= 0:
        print(i+1)
        exit()

res = ceil(h / max_a) + len(ab)
print(res)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
sum_satisfaction = sum(b)

for i in range(1,n):
    if(i < n-1 and  a[i] == a[i-1] + 1 ):
        sum_satisfaction = sum_satisfaction + c[i]
print(sum_satisfaction)
# Judge status: Accepted
N,M = map(int, input().split())
A = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
# print(A[0]) 
F=N-sum(A)
if F>=0:
    print(F)

if F<0: 
    print(-1)
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    if a > 0 and b > 0:
        print('Positive')
    elif (a > 0) ^ (b > 0) or a == 0 or b == 0:
        print('Zero')
    else:
        if (a - b) % 2 != 0:
            print('Positive')
        else:
            print('Negative')


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, k = map(int, input().split())
MOD = 1e9+7

a = [0] * (n+2)
s = [0] * (n+2)
a[1] = (n+1)
s[1] = a[1]
for i in range(2,n+2):
    add = ( a[i-1] + n - 2 * (i-1) ) % MOD
    if add < 0:
        add += MOD

    a[i] = add

    add = (s[i-1] + a[i]) % MOD
    if add < 0:
        add += MOD

    s[i] = add

print(int(s[n+1] - s[k-1]))
# Judge status: Accepted
#template
def inputlist(): return [int(j) for j in input().split()]
#template
N = int(input())
L = inputlist()
L.sort()
ans = 0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L[i]+ L[j] > L[k] and L[i] != L[j] and L[j] != L[k]:
                ans +=1
print(ans)
# Judge status: Accepted
X = int(input())

while True:
  flag = True
  for i in range(2,X):
    if X%i == 0:
      flag = False
      break
  if flag:
    break
  X += 1
  
print(X)
# Judge status: Accepted
k, a, b = map(int, input().split())

if b-a<=2 or a>k-1:
    print(k+1)
else:
    k -= a-1
    print(a + (b-a) * (k//2) + k %2)
# Judge status: Accepted
N = int(input())

ans = 0
tmp = -10
for i in range(N):
    a = int(input())
    if tmp == i-1 and a > 0:
        ans += 1
        a -= 1
    ans += a//2
    if a%2 == 1:
        tmp = i
print(ans)
# Judge status: Wrong Answer
import sys

N,K=map(int,input().split())
D=dict()
for i in range(N):
  a,b=input().split()
  try:
    D[a]+=int(b)
  except:
    D[a]=int(b)

D=sorted(D.items(),key=lambda x:x[0])


for k,v in D:
  K-=v
  if K<=0:
    print(k)
    break
# Judge status: Wrong Answer

n,k = map(int,input().split())
d = int(input())

ans = n-d

print(ans)
# Judge status: Wrong Answer
import sys
readline = sys.stdin.buffer.readline

n,m = map(int,readline().split())
lst1 = list(map(int,readline().split()))
ans = 0
for i in range(1,n):
    if lst1[i-1]+lst1[i] > m:
        res = max(0,lst1[i]-(m-lst1[i-1]))
        #print(res)
        ans += res
        lst1[i] = lst1[i]-res

if lst1[0]+lst1[1] > m:
    ans += lst1[0]-m

print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
print((a*b)//2 if (a*b)%2 == 0 else ((a*b)//2)+1)
# Judge status: Accepted
n = int(input())
t, a = [int(x) for x in input().split()]
h_list = [int(x) for x in input().split()]
temp_list = sorted([(abs((t - h * 0.006) - a), i + 1) for i, h in enumerate(h_list)])
print(temp_list[0][1])
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = []
B = []
for _ in range(N):
    A.append(input())
for __ in range(M):
    B.append(input())

for i in range(N-M):
    if B[0] in A[i]:
        for j in range(N-M):
            for k in range(M):
                if B[k] != A[i+k][j:j+M]:
                    break
            print('Yes')
            exit()
print('No')
exit()
# Judge status: Wrong Answer
import copy
N = int(input())
X = list(map(int,input().split()))
length = len(X)
X.sort()
bef = int(length/2)
aft = bef+1
for i in range(bef):
    print(X[bef-1])
for i in range(length-bef):
    print(X[aft-1])
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

score = B[A[0]-1]
for i in range(1,N):
    score += B[A[i]-1]

for j in range(0, N-1):
    if A[j+1] - A[j] == 1 and j != 0:
        score += C[j-1]
print(score)
# Judge status: Wrong Answer
a1,a2,a3 = map(int,input().split())
if a1+a2+a3>=22:
  print("burst")
else:
  print("win")
# Judge status: Wrong Answer
a = input()
input_s = input()

b = int(a)

if 3200 <= b:
    output_s = ("input_s")
elif b <3200:
    output_s = ("red")

print(output_s)
# Judge status: Accepted
a = input()

if a == a.upper():
    print("A")
else:
    print("a")
# Judge status: Accepted
A,B = map(int, input().split())
print(A*B if max(A,B) <= 9 else -1)
# Judge status: Wrong Answer

N = int(input())
X = list(map(int, input().split()))

cnt = [0] * (N + 1)
cnt[0] = 1
for i in range(N):
    cnt[i + 1] = (cnt[i] - X[i]) * 2

ans = 0
cur = 0
for i in reversed(range(N + 1)):
    cur += X[i]
    ans += min(cnt[i], cur)

if all(cnt[i] >= X[i] for i in range(N)):
    print(ans)
else:
    print(-1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
k = int(input())

ans = 0
ans = max(a * (2 * k) + b + c, b * (2 * k) + a + c, c * (2 * k) + a + b)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())

diff = B - A
height_A = diff * (diff - 1) // 2

ans = height_A - A

print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
maxL = 0
minR = N
for i in range(M):
    L, R = map(int, input().split())
    maxL = max(maxL, L)
    minR = min(minR, R)
if minR - maxL >= 0:
    print(minR - maxL + 1)
else:
    print(0)
# Judge status: Accepted
N = int(input())
if N%1000 == 0:
  print(0)
else:
  print(1000-(N%1000))
# Judge status: Accepted
H,N = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
dp = [0]+[float("inf")]*H
for i in range(N):
    for h in range(H+1):
        t = h + AB[i][0] 
        if h + AB[i][0] > H:
            t = H
        dp[t] = min(dp[t],dp[h]+AB[i][1])
print(dp[H])
# Judge status: Wrong Answer
import math
a,b,h,m = map(int,input().split())
short = h*30+m/2
long = m*6
ang = abs(short-long)
ang = ang if ang <= 180 else ang-180
hen = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(ang)))
print(hen)
# Judge status: Accepted
n, m = map(int, input().split())
wa = [0]*n
ac = [0]*n
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == 'AC' and ac[p] == 0:
        ac[p] = 1
    elif s =='WA' and ac[p] == 0:
        wa[p] += 1
for j in range(n):
    if ac[j] == 0:
        wa[j] = 0
print(sum(ac), sum(wa))
# Judge status: Wrong Answer
A, B = map(int, input().split())
T = A+B
if (T <= 24):
    print(T)
else:
    print(T-24)
# Judge status: Accepted
import sys

h, w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
  sys.exit()

if h % 2 == 1 and w % 2 == 1:
  print(int(h*w//2 + 1))
else:
  print(int(h*w//2))
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
count=1
if(h>=w):
    big=h
    small=w
else:
    big=w
    small=h
n=n-small
count=count+int(n/(big))
print(count)
# Judge status: Wrong Answer
a,b,c = input().split(' ')

# aとbが等しい　かつ　aはcと等しくない
if a == b and a != c:
    print("Yes")
# それ以外の時
else:
    print("No")
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
L = [0] * b
for i in range(1, b):
    s = (a * i) % b
    if L[s] == 1:
        print('No')
        break
    elif s == c:
        print('Yes')
        break
    else:
        L[s] = 1
else:
    print('No')
# Judge status: Wrong Answer
n,m = map(int,input().split())
graph = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    graph[a-1][b-1] = 1
    graph[b-1][a-1] = 1

flag = False
for i in range(n):
    if graph[0][i] == 1:
        for j in range(n):
            if graph[i][j] == 1:
                flag = True
                break
                
if flag:
    print("POSSIBLE")
    
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N = int(input())
h = list(map(int, input().split()))

for i in range(1, N):
    if h[i] - h[i - 1] >= 1:
        h[i] -= 1

for i in range(1, N):
    if h[i] - h[i - 1] < 0:
        print('No')
        exit()

print('Yes')
# Judge status: Accepted
s = input()
for bit in range(1<<len(s)-1):
  f = s[0]
  
  for i in range(len(s)-1):
    if (bit>>i) & 1:
      f += '+'
    else:
      f += '-'
    f += s[i+1]
  
  if eval(f) == 7:
    print(f+'=7')
    exit()
# Judge status: Accepted
a,b=map(int,input().split())
if b>=a:
  print(a)
else:
  print(a-1)
# Judge status: Accepted
def main():
    footing = int(input())
    height = list(map(int, input().split()))
    answer = [0] * footing
    answer[1] = abs(height[1] - height[0])
    for i in range(2, footing):
        answer[i] = min(answer[i - 2] + abs(height[i] - height[i - 2]), answer[i - 1] + abs(height[i] - height[i - 1]))
    print(answer[-1])


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())

def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

nums = divisor(n)
total = []
for i in range(len(nums)):
    s = int(n/nums[i])
    total.append(s-1 + nums[i]-1)

print(min(total))
# Judge status: Wrong Answer
X,Y= map(int, input().split())
ans='Yes'
for i in range(X+1):
    if Y!=2*i+4*(X-i):
        print('No')
        break
print('No')
# Judge status: Wrong Answer
N = int(input())
l = list()
for i in range(N):
  X, L = map(int, input().split())
  left = X - L
  right = X + L
  l.append([left, right])
l.sort()
cnt = 0
n = 0
t = 1
while t < N:
  if l[n][1] > l[t][0]:
    cnt += 1
  else:
    n = t
  t += 1
print(N - cnt)
# Judge status: Wrong Answer
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
output = 0
for i in range(k):
  for j in range(k):
    for h in range(k):
      output += gcd(i,j,h)
print(output)
# Judge status: Accepted
S = input()
K = int(input())

A = [" " for _ in range(len(S))]

zan = K
for i in range(len(S)):
  n = (ord('z') - ord(S[i]) + 1) % 26 # aに変換するのに必要な回数
  if zan >= n:
    zan -= n
    A[i] = 'a'
  else:
    A[i] = S[i]

if zan > 0:
  A[-1] = chr((ord(A[-1]) - ord('a') + zan)%26 + ord('a'))
print("".join(A))
# Judge status: Accepted
import sys

[A, B] = [int(x) for x in sys.stdin.readline().strip().split(" ")]

current = 1
result = 0
while current < B:
    result += 1
    current += A - 1

print(result)
# Judge status: Accepted
K = int(input())
if K % 2 == 0:
	print((K//2)**2)
else:
	print((K//2)*((K//2)+1))
# Judge status: Wrong Answer
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
AB.reverse()
count = 0

for a,b in AB:
  num_a = a+count
  if b == 1:
    if num_a == 0:
      count += 1
    else:
      continue
  elif a%b == 0:
    continue
  else:
    count += (b-num_a%b)

print(count)
# Judge status: Accepted
def p_a():
    import string
    l = string.ascii_lowercase
    c = input()
    print(l[l.index(c) + 1])
    
p_a()
# Judge status: Wrong Answer
for number in range(1, 30 + 1):
    if (number % 3 == 0) and (number % 5 == 0):
        print('FizzBuzz')
    elif number % 3 == 0:
        print('Fizz')
    elif number % 5 == 0:
        print('Buzz')
    else:
        print(str(number))
# Judge status: Accepted
def main():
   x = int(input())
   x ^= 1
   print(x)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import Counter

n = int(readline())
d = list(map(int, readline().split()))
counter = Counter(d)
mod = 998244353
ans = 1
if d[0] != 0 or counter[0] != 1:
    print(0)
    exit()
for i in range(1, max(d) + 1):
    ans *= pow(counter[i - 1], counter[i], mod)
    ans %= mod
print(ans)
# Judge status: Accepted
k = int(input())

l = [0]
for i in range(1, k + 1):
    l.append(l[-1] + i // 2)
# l = [0, 0, 1, 2, 4, 6, 9, 12, ... k]

print(l[-1])
# Judge status: Accepted
import math
print(2 ** (math.floor(math.log2(int(input())))+1) - 1)
# Judge status: Accepted
k = int(input())
mod = 7 % k
counter = 1
memo = 1
mod_map = set()
mod_map.add(mod)
while mod != 0:
    mod = ((mod * 10) % k + 7) % k
    if mod not in mod_map:
        mod_map.add(mod)
    else:
        counter = -1
        break
    counter += 1
    if mod == 0:
        break
print(counter)
# Judge status: Wrong Answer
import math
n,d=map(int,input().split())
X=[]
for i in range(n):
    x=list(map(int,input().split()))
    X.append(x)
cnt=0
for i in range(n):
    for j in range(i+1,n):
        s=0
        for a,b in zip(X[i],X[j]):
            s+=(a-b)**2
        s=math.sqrt(s)
        print(s)
        if s.is_integer():
            cnt+=1
print(cnt)
# Judge status: Accepted
from collections import deque
s=input()
d=deque()

for i in s:
    if i=="S":
        d.append("S")
    elif i=="T" and (not d or d[-1]=="T"):
        d.append("T")
    else:
        d.pop()
print(len(d))
# Judge status: Wrong Answer
a, b = map(int, input().split())
print("Possible" if a % 3 == 3 or b % 3 == 0 or (a + b) % 3 == 0 else "Impossible")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

l = [(a[i], i) for i in range(n)]
l = sorted(l)
ans = []
for i in range(n):
    ans.append(str(l[i][1] + 1))

ans = " ".join(ans)
print(ans)
# Judge status: Wrong Answer
x=int(input())
import math
a=x//500
b=(x-a*500)//50
print(1000*a+5*b)
# Judge status: Accepted
n=int(input())

if n%2==1:
    print(0)
else:
    cnt=1
    ans=0
    while 2*5**cnt<=n:
        ans+=n//(2*5**cnt)

        cnt+=1
    print(ans)
# Judge status: Accepted
a=int(input())
s=input()
if(a>=3200):
  print(s)
else:
  print("red")
# Judge status: Accepted
x,y,z=map(int,input().split())
s=0
c=0
i=0
while(s<z+0.5):
    c+=y
    s+=x
    if(s>z):
        c-=y
print(c)
# Judge status: Wrong Answer
n = input()
print("YES" if "753" in n else "NO")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
c4 = 0
c2 = 0
for i in a:
    if i%4 == 0:
        c4 += 1
    elif i%2 == 0:
        c2 += 1
c0 = n - c4 - c2

ans = False
if c2 < 2:
    if c0 + c2 <= 2*c4:
        ans = True
else:
    if c0 <= c4*2:
        ans = True
if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    ans = 0

    for i in range(1, n + 1):
        # k = n // i
        # kk = int((k + 1) * (k / 2) * i)
        # ans += kk
        for j in range(i, n + 1, i):
            ans += j
    print(ans)    

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
if N % 2 ==0:
  print((N/2)**2)
else:
  print(((N-1)/2)*(1+(N-1)/2))
# Judge status: Wrong Answer
N = input()
h = int(N[0])
t = int(N[1])
o = int(N[2])

if h == t and t == o:
    print(N)
elif h == 9:
    print(999)
else:
    h += 1
    print(h*111)
# Judge status: Accepted
print((int(input())+int(input()))*int(input())//2)
# Judge status: Accepted
from operator import itemgetter
s = input()
l = len(s)
ans = []
flag = False 
for i in range(l):
    if flag:
        if s[i] in "AGCT":
            continue
        else:
            ans.append([i-start,start,i])
            flag = False
    if s[i] in "AGCT":
        flag = True
        start = i 
else:
    if flag:
        ans.append([l-start,start,l])
ans.sort(key=itemgetter(0),reverse=True)
#print(s[ans[0][1]:ans[0][2]])
if ans:
    print(ans[0][0])
else:
    print(0)
# Judge status: Wrong Answer
a=list(map(int, input().split()))
sum=3
if a[0]==a[1]:
  sum-=1
if a[0]==a[2]:
  sum-=1
if a[1]==a[2]:
  sum-=1
print(sum)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if c in list(range(a,b)):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
k, n, *A = read().split()
far = int(k) + int(A[0]) - int(A[-1])
for x, y in zip(A[1:], A):
    if far < int(x) - int(y):
        far = int(x) - int(y)
print(int(k)-far)
# Judge status: Wrong Answer
a = input()
num = map(int, input().split())
num_max = max(num)
num_sum = sum(num) - num_max
if(num_sum > num_max):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x, y = map(int, input().split())
A = [1, 3, 5, 7, 8, 10, 12]
B = [4, 6, 9, 11]
if x in A and y in A:
  print("Yes")
elif x in B and y in B:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
#!/usr/bin/env python3
n, m = map(int, input().split())
d = m
r = d + 1
for i in range(m):
    if d <= 0:
        break
    a = i + 1
    b = a + d
    print(a, b)
    d -= 2
d = m - 1
for i in range(m):
    if d <= 0:
        break
    a = r + i + 1
    b = a + d
    print(a, b)
    d -= 2
# Judge status: Accepted

from collections import Counter
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
A_set = np.unique(A)
count_dict= Counter(A)
count_sum = np.sum([count_dict[i]*(count_dict[i]-1)/2 for i in A_set])

out = [int(count_sum-count_dict[i]+1) for i in A]
for i in out:
    print(i)
# Judge status: Wrong Answer
q, h, s, d = map(int, input().split())

q *= 4
h *= 2
d //= 2

n = int(input())

if n % 2 == 0:
    print(n * min(q, h, s, d))
else:
    tmp = min(q, h, s)
    if n > 1 and d < tmp:
        print((n - 1) * d + tmp)
    else:
        print(n * tmp)
# Judge status: Accepted
x = sorted(list(map(int, input().split())))
if x[0]+x[1] == x[2]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
p, q, r = map(int, input().split())

print(min(p+q, q+r, r+q))
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

cnt = 0
a.sort(reverse=True)
print(a)

for i in range(1, 2*N, 2):
    cnt += a[i]

print(cnt)
# Judge status: Wrong Answer
import collections
n=int(input())
a=list(map(int,input().split()))
ans=0
b=[]
for i in range(n):
    b.append(abs(a[i]-i+1))
#print(b)
ans=0
b=collections.Counter(b)
for i in b.values():
    ans+=i*(i-1)//2
print(ans)

#print(ans)