peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
S = input()

for i in range(len(S)):
    for j in range(len(S)):
        if S[:j]+S[i:] == "keyence":
            print("YES")
            exit()
print("NO")
# Judge status: Accepted
a,b,c = map(int,input().split())
if a == b == 5 and c== 7:
  print("YES")
elif a == c == 5 and b== 7:
  print("YES")
elif c == b == 5 and a== 7:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
l,r = map(int,input().split())
li = []
r = min(r,l+4040)
for i in range(l,r):
    for j in range(i+1,r+1):
        li.append(i*j%2019)
print(min(li))
# Judge status: Accepted
H, N = map(int, input().split())
A = []
B = []
for _ in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)

dpl = H+max(A)
x = 10**10
dp = [x]*dpl
dp[0] = 0

for a, b in zip(A, B):
    for i in range(a, dpl):
        dp[i] = min(dp[i-a]+b, dp[i])
    for i in range(dpl-2, -1, -1):
        dp[i] = min(dp[i+1], dp[i])

print(dp[H])
# Judge status: Wrong Answer
d,n=map(int,input().split())

if d==0:
	print(n if n<=100 else n+1)
else:  
	print(100**d * n if n<=100 else 100**d * (n+1))
# Judge status: Accepted
l = list(map(int, input().split()))
l.sort(reverse = True)
print(int(str(l[0]) + str(l[1])) + l[2])
# Judge status: Wrong Answer
A,B=list(map(int,input().split()))
C=list(map(int,input().split()))
C.sort()
ans = 0
for i in C:
    if B >= i:
        ans+=1
        B-=i
    else:
        print(ans)
        exit()
print(ans)
# Judge status: Accepted
N,D=open(0)
*D,=map(int,D.split())
c=[0]*-~max(D)
for i in D:c[i]+=1
a=D[0]<1==c[0]
for i,j in zip(c,c[1:]):a*=i**j
print(a%998244353)
# Judge status: Accepted
s=str(input())
for i in range(len(s)):
  if s[i]=="A":
    a=i
    break
t=s[::-1]
for j in range(len(s)):
  if t[j]=="Z":
    b=j
    break

print(len(s)-a-b)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
k = [0 for i in range(n)]
t = []
for i in range(n-1,-1,-1):
  a = l[i]
  if a!=k[i]:
    t.append(i+1)
    for j in range(i,int((i+1)**0.5-1),-1):
      if (i+1)%(j+1)==0:
        k[j] += 1
        k[(i+1)//(j+1)-1] += 1
        k[j] %= 2
        k[(i+1)//(j+1)-1] %= 2
if len(t)==0:
  print(0)
else:
  print(len(t))
  print(*t)
# Judge status: Accepted
s = input()
s = sorted(s)

if s == ['a', 'b', 'c']:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b = input().split()

out_1 = int(a*int(b))
out_2 = int(b*int(a))

print(max(out_1, out_2))
# Judge status: Wrong Answer
N = int(input())

for i in range(N):
    if i**2>N:
        break

print((i-1)**2)
# Judge status: Wrong Answer
import math

x = int(input())
saving = 100
ans = 0

while saving <= x:
    saving = math.floor(saving * 1.01)
    ans += 1

print(ans)
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
p = sorted(map(int, input().split()), reverse=True)[:x]
q = sorted(map(int, input().split()), reverse=True)[:y]
r = list(map(int, input().split()))
ls = sorted(p+q+r, reverse=True)[:x+y]
print(sum(ls))
# Judge status: Wrong Answer
import sys
n = input()
for i in n:
    if n.count(i) >= 3:
        print('Yes')
        sys.exit()
print('No')
# Judge status: Wrong Answer
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
if (sum(A)+sum(B)+sum(C))//3 == A[0]+B[1]+C[2] == A[2]+B[1]+C[0]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
X=int(input())
if X>=30: print('Yes')
else: print('No')
# Judge status: Accepted
A, B, C = map(int, input().split())
S = sorted([A,B,C])

if S[2] == S[0] + S[1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,k,q = map(int,input().split())
start = [k-q]*n
answerlist = [int(input()) for _ in range(q)]
for i in tuple(answerlist):
  start[i-1] = start[i-1]+1
for i in range(n):
  if start[i]<=0:
    print("No")
  else:
    print("Yes")
# Judge status: Wrong Answer
N = int(input())
# (0.9)確定以外のAnの場合の数 * [(0.9), (9,0)]の２通り * [(0,9),(9,0)]の場合の数
ans = (10 ** (N - 2) * 2 * (N - 1)) % (10 ** 9 + 7) 
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

def f(length, ls):
    cur = 0
    for a in ls:
        if a%length == 0:
            cur += a//length - 1
        else:
            cur += a//length
    if cur <= K:
        return True
    else:
        return False

ok, ng = max(A), 0
while abs(ok - ng) > 1:
    z = (ok+ng)//2
    if f(z, A) == True:
        ok = z
    else:
        ng = z
print(ok)
# Judge status: Accepted
s = input()
ans = 0
c = ''
b = ''
for i in list(s):
    c += i
    if c != b:
        ans += 1
        b = c
        c = ''
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
can = b//a
 
if(c<can):
    print(c)
else:
    print(can)
# Judge status: Accepted
N = int(input())

ans = 0
for n in range(int(N ** 0.5), 0, -1):
    if N % n == 0:
        ans = n + (N // n) - 2
        break

print(ans)
# Judge status: Accepted
n, k = list(map(int, input().split()))

arr = list(map(int, input().split()))
arr.sort()

print(sum(arr[:k]))
# Judge status: Wrong Answer
a = list(map(int, input().split()))
b=sorted(a, reverse=True)
print(sum(b[0::2])-sum(b[1::2]))
# Judge status: Wrong Answer
# C - Candles

N, K = map(int, input().split())
X = list(int(x) for x in input().split())

alt_X = []
for x in X:
    if x < 0:
        alt_X.append((x*-2, 1))
    else:
        alt_X.append((x, 0))
alt_X.sort()

l = 0
r = 0

for (val, flg) in alt_X[:K]:
    if flg == 0:
        r = max(r, val)
    else:
        l = max(l, val)

print(l+r)
# Judge status: Accepted
n=int(input())
count=0
ans=[]
for i in range(1,n+1):
    count+=i
    ans.append(i)
    if count==n:
        break
    elif count>n:
        x=count-n
        del ans[x-1]
        break

for i in range(len(ans)):
    print(ans[i])
# Judge status: Accepted
N, M = map(int, input().split())
L = [[] for _ in range(N+1)]
for _ in range(M):
    a, b = map(int, input().split())
    L[a].append(b)
    L[b].append(a)

ans = [0 for _ in range(N+1)]
now = [1]
next = []

while len(now):
    for x in now:
        for y in L[x]:
            if (ans[y] == 0) and (y not in now):
                ans[y] = x
                next.append(y)
    now = next.copy()
    next = []

print("Yes")
for x in range(2, N+1):
    print(ans[x])
# Judge status: Accepted
import itertools
n = int(input())
a = list(map(int, input().split()))

n_acc = itertools.accumulate(a)
#r_acc = itertools.accumulate(a[::-1])
# 1, 3, 6, 10, 15 ,21
# 1 vs 20
# 3 vs
#print(n_acc, r_acc)


sigma = sum(a)
ans = 10 ** 16

for i, val in enumerate(n_acc):
    if (i == len(a) - 1):
        break

    rest = sigma - val
    ans = min(abs(val - rest), ans)


print(ans)
# Judge status: Accepted
s = input()
l = len(s)
ans = 0
for i in range(l):
    loc = 0
    idx = i 
    while s[idx] in ["A","C","G","T"] and idx<l:
        loc += 1
        idx += 1
        if idx>=l:
            break
    ans = max(ans,loc)
print(ans)
# Judge status: Wrong Answer
s=input()

print('x' for _ in  range(len(s)))
# Judge status: Accepted
#!python3

# input
X, Y = list(map(int, input().split()))


def main():
    ans = 0
    x = X
    while x <= Y:
        ans += 1
        x *= 2
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n=int(input())
a=[int(x) for x in input().split()]
mi=min(a)
ans_l=[]
for i in a:
  if i==mi:
    ans_l.append(i)
  else:
    ans_l.append(i%mi)

odd=0
even=0
for i in ans_l:
  if i%2==0:
    even+=1
  else:
    odd+=1

if odd==0 and 0<=even:
  print(min(a))
else:
  print(1)
# Judge status: Wrong Answer
def main():
    n = int(input())
    if n%2==1:
        print(0)
        return
    md = 10
    cnt = 0
    while n>md:
        cnt += n//md
        md = md*5
    print(cnt)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

if len(s) == 2:
    print('')
    sys.exit(0)

for i in range(1, len(s) // 2):
    split_index = (len(s) - i * 2) // 2
    if s[:split_index] == s[split_index:len(s) - i * 2]:
        print(len(s) - i * 2)
# Judge status: Accepted
N = int(input())

ans_rev = "" if N else "0"
while N:
    if N % 2 == 1:
        ans_rev += '1'
        N -= 1
    else:
        ans_rev += '0'
    N //= (-2)

print(ans_rev[::-1])
# Judge status: Accepted
a = int(input())
b = list(map(int, input().split()))
count = 0

for i in range(a):
  if (i + 1) % 2 != 0:
    if b[i] % 2 != 0:
      count += 1
      
print(count)
# Judge status: Wrong Answer
import bisect
N = int(input())
A = [int(x) for x in input().split()]
index = 0
for i in range(1, N+1):
    now = bisect.bisect_right(A, i)
    print(now - index)
    index = now
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
t = s[:a] + s[-b:]
flg = s[a] == "-" and t.isdecimal()
print(["No", "Yes"][flg])
# Judge status: Accepted
#AGC031 A Colorful Subsequence
# Answer
N = int(input())
S = input()
alpha = [0]*26
mod = 10**9+7

for n in S:
    num = ord(n)-97
    alpha[num] += 1
    
ans = 1
for i in range(26):
    ans *= (alpha[i]+1)

ans -= 1
ans %= mod
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
places = list(map(int, input().split()))

dp_table = [99999999] * (N+1)

# 初期化
dp_table[0] = 0
dp_table[1] = abs(places[1] - places[0])

for i in range(2, N):
    for j in range(1, K+1):
        cost = dp_table[i-j] + abs(places[i] - places[i-j])
        dp_table[i] = dp_table[i] if cost > dp_table[i] else cost

print(dp_table)
# Judge status: Accepted
# 初期入力
import math
from math import ceil
import sys
input = sys.stdin.readline
N,K = (int(x) for x in input().split())

num_prob =1/N
ans =0
for i in range(1,N+1):
    
    if K <=i:
        ans =(ans + num_prob)
    else:
        x =ceil(math.log2(K/i))
        ans += num_prob *(0.5**x) #サイコロの確立と表が出続ける確率
print(ans)
# Judge status: Wrong Answer
n = int(input())
ab = [map(int, input().split()) for _ in range(n)]
a, b = [list(i) for i in zip(*ab)]
 
a.reverse()
b.reverse()
ans = 0
num = 0
ruisekiwa = 0

for j in range(n):
  a[j] += ruisekiwa
  syou = a[j]//b[j]
  if a[j] == 0:
    num = 0
  elif b[j] == 1:
    num = 0
  else:
    num = b[j]*(syou+1) - a[j]
  ruisekiwa += num
  ans += num

print(ans)
# Judge status: Wrong Answer
S = input()
 
# Pythonでは S[3]='8' のような操作は許されないので間接的な方法を用いる
print('2018/01/' + S[-2])
# Judge status: Accepted
n = int(input())
ab = []
for _ in range(n):
    ab.append(list(map(int,input().split())))

cnt = 0
for i in range(n-1,-1,-1):
    a,b = ab[i][0],ab[i][1]
    num = a + cnt
    if num % b == 0:
        continue
    else:
        amari = num % b
        cnt += b-amari
    
print(cnt)
# Judge status: Accepted
N = int(input())
ans = 0

for i in range(1,N):
    for j in range(1,N):
        if i*j<N:
            ans+=1
        else:
            break

print(ans)
# Judge status: Accepted
from math import ceil

# input
N, D = map(int, input().split())

# check
c = 2 * D + 1

print(ceil(N / c))
# Judge status: Wrong Answer
N, K = map(int, input().split())
S = list(str(input()))

S[N-1] = S[N-1].lower()

s = ''.join(S)
print(s)
# Judge status: Wrong Answer
# abc097_a
# 絶対値abs

a, b , c, d = map(int, input().split())

if abs(a-c) <= d:
    print('Yes')

elif abs(b - c) <= d and abs(a - b):
    print('Yes')

else:
    print('No')
# Judge status: Accepted
n, k = map(int, input().split())

a = [0]*n
for i in range(k):
    d = int(input())
    s = list(map(int, input().split()))
    for j in range(d):
        a[s[j]-1] = 1
cnt = 0
for i in range(n):
    if a[i] == 0:
        cnt += 1
        
print(cnt)
# Judge status: Accepted
n = int(input())
A = [int(input()) for i in range(n)]
s = sum(A)
if s % 10:
	print(s)
else:
	for a in sorted(A):
		if a % 10:
			print(s - a)
			exit()
	else:
		print(0)
# Judge status: Accepted
import math
n, x, t = map(int, input().split())
print(math.ceil(n/x)*t)
# Judge status: Accepted
a, b, t = map(int, input().split())
c = 0
for number in range(1, 21):
    if a * number < t + 0.5:
        c += b
    else:
        pass
print(c)
# Judge status: Wrong Answer
n=int(input())
s=str(input())

result=""

for i in s:
    result += chr(ord(i)+n%26)

print(result)
# Judge status: Accepted
n = int(input())
s = input()
l = 0
r = s.count('.')
# if s[0] == '#':
#     l += 1
# else:
#     r -= 1
ans = float('inf')
for i in range(n-1):
    if s[i] == '#':
        l += 1
    else:
        r -= 1
    ans = min(ans, l+r)
    # print(ans, l, r)
ans = min(ans, s.count('.'))
ans = min(ans, s.count('#'))
print(ans)
# Judge status: Wrong Answer
def resolve():
  a, b, x = map(int, input().split(" "))

  diff = b - a
  result = diff // x
  if b%x==0 or a%x==0:
    result += 1
  print(result)

if __name__ == "__main__":
  resolve()
# Judge status: Accepted
a,b,c = map(int, input().split())

if min(a,b) <= c <= max(a, b):
    print('Yes')
else:
    print('No')
# Judge status: Accepted

a,b,c=map(int,input().split())

print(c if c<=b/a else b//a)
# Judge status: Accepted
n,k=map(int, input().split())
xlist=list(map(int, input().split()))
ans=10**20
for i in range(n-k+1):
  ans=min(abs(xlist[i]-xlist[i+k-1])+min(abs(xlist[i]),abs(xlist[i+k-1])),ans)
print(ans)
# Judge status: Wrong Answer
a = list(map(int, input().split()))
if sum(a) >= 22:
  print('busu')
else:
  print('win')
# Judge status: Wrong Answer
import sys
s = list(input())
c = len(s)
if c%2 == 1:
    print("No")
    sys.exit()
else:
    for i in range(c//2):
        if not s[2*i] == "h" and s[2*i+1] == "i":
            print("No")
            sys.exit
print("Yes")
# Judge status: Accepted
A,B,C = map(int, input().split())

x = A - B

if C <= x:
    res = 0
else:
    res = C - x

print(res)
# Judge status: Accepted
#!/usr/bin/env python3


def solve(N, A):
    MOD = 10**9 + 7
    total = sum(A)
    ans = 0

    for i in range(N - 1):
        total -= A[i]
        ans += A[i] * total
        ans %= MOD

    return ans


def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = solve(N, A)

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b,x = map(int,input().split())
if a%x!=0:
    temp = a%x
    a += x-temp
if a>b:
    print(0)
elif a==b:
    print(1)
else:
    temp = (b-a)//x
    print(temp+1)
# Judge status: Accepted
def getval():
    n = int(input())
    h = list(map(int,input().split()))
    return n,h 

def main(n,h):
    dp = [0,abs(h[1]-h[0])]
    for i in range(1,n-1):
        x = dp[-1]+abs(h[i+1]-h[i])
        y = dp[-2]+abs(h[i+1]-h[i-1])
        dp.append(min(x,y))
    print(dp[-1])
        
if __name__=="__main__":
    n,h = getval()
    main(n,h)
# Judge status: Accepted
#!/usr/bin/env python3

vocab = set(['dream', 'dreamer', 'erase', 'eraser'])

def parse(s):
    stack = [0]
    while stack:
        i = stack.pop()
        if i == len(s):
            return True
        for w in vocab:
            if s[i:].startswith(w):
                stack.append(i + len(w))
    return False

s = input()
if parse(s):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n = int(input())

id = 0
res = []
for i in range(n):
    id += 1
    s, p = map(str, input().split())
    res.append([s, -1 * int(p), id])

res = sorted(res, key=lambda x: (x[0], x[1]))

for i in res:
    print(i[2])
# Judge status: Wrong Answer
import math


def is_prime(n):
    for i in range(2, math.ceil(math.sqrt(n)) + 1):
        if n % i == 0:
            return False
    return True


X = int(input())

while not is_prime(X):
    X += 1

print(X)
# Judge status: Accepted
n = int(input())
if 1 <= n and n <= 999:
    print('ABC')
else:
    print('ABD')
# Judge status: Accepted
from collections import Counter
a = []
for i in range(int(input())):
    a.append(input())
a = Counter(a)
m = a.most_common()[0][1]
for i, j in sorted(a.most_common()):
    if j ==m: print(i)
# Judge status: Wrong Answer
import collections
N = int(input())
a = list(map(int, input().split()))
if N == 1:
    print(1)
    exit()
c = collections.Counter(a)
c_key = list(c.keys())
c_value = list(c.values())
res = 0
for i in range(1,len(c)-1):
    temp = c_value[i]
    if int(c_key[i])-int(c_key[i-1]) == 1:
        temp += c_value[i-1]
    if int(c_key[i+1])-int(c_key[i]) == 1:
        temp += c_value[i+1]
    if temp > res:
        res = temp
print(res)
# Judge status: Accepted
import math 

K = int(input())

def sol(K):
    res = 0
    for i in range(1, K+1):
        for j in range(1, K+1):
            t = math.gcd(i, j)
            for k in range(1, K+1):
                res += math.gcd(k, t)

    return res
  
print(sol(K))
# Judge status: Accepted
def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(x % y, y)


n = int(input())
a = list(map(int, input().split()))
ans = 0
for x in a:
    ans = gcd(ans, x)
print(ans)
# Judge status: Accepted
n = input()
if n[2]==n[3] and n[4]==n[5]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
list_a = list(map(int,input().split()))
list_a.sort(reverse=True)
alice = 0; bob = 0
for i in range(len(list_a)):
    if i % 2 == 0:
        alice += list_a[i]
    else:
        bob += list_a[i]
print(alice-bob)
# Judge status: Accepted
k = []
for i in range(1,40):
  for j in range(2,30):
    if i**j <= 1000:
      k.append(i**j)
L = set(k)
P = list(L)
P.sort()
X = int(input())
ans = 0
if X == 1000:
  print(1000)
else:
  for i in range(len(P)):
    if X<P[i]:
      print(ans)
      break
    else:
      ans = P[i]
# Judge status: Accepted
a,b,x = list(map(int, input().split()))

volume = a*a*b

import math
# 半分以下
if 2 * x <= volume:
    print(90 - math.degrees(math.atan(2*(x/b/a)/b)))
else:
    print(math.degrees(math.atan(2*(volume-x)/a/a/a)))
# Judge status: Accepted
mx = 0
s = 0
for _ in range(5):
  ai = int(input())
  if ai%10 == 0:
    s += ai
  else:
    s += 10*(ai//10)+10
    if 10-ai%10 > mx:
      mx = 10-ai%10
print(s-mx)
# Judge status: Accepted
N = int(input())
A =[int(x) for x in input().split()]
ans = [0]*N
 
for i in range(N):
  ans[A[i]-1] = i+1

print(*ans)
# Judge status: Wrong Answer
s = input()
a = int(s.count("A"))
b = int(s.count("B"))

if a or b == 3:
    print("No")

else:
    print("Yes")
# Judge status: Accepted
x, y = map(int, (input().split()))
print(int(x + y / 2))
# Judge status: Accepted
# 2020/01/19
# AtCoder Beginner Contest 152 - A

# Input
c, d = map(int,input().split())

# Calc
if c == d:
    ans = "Yes"
else:
    ans = "No"

# Output
print(ans)
# Judge status: Accepted
string = input()

length = len(string)
sindex = 0
for i in range(0, length):
  if string[i] == "S": 
    sindex = i
    break
    
s_count = 0

for i in range(sindex, len(string)):
  if string[i] == "S": s_count += 1
  if string[i] == "T" and s_count > 0:
    s_count -= 1
    length -= 2
    
print(length)
# Judge status: Accepted
s=input()
a=s.count("a")
b=s.count("b")
c=s.count("c")
if max(a,b,c)-min(a,b,c)<=1:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
import collections
N = int(input())
S = input()
A = collections.Counter(S)
B = list("qwertyuiopasdfghjklzxcvbnm")
C = []
for i in B:
    C.append(A[i])
D = [i+1 for i in C if i != 0]
ans = 1
for i in range(len(D)):
    ans *= D[i]
print(ans-1)
# Judge status: Accepted
S = input()[::-1]
digits = 1
Sum, ans = 0, 0
l = [0] * 2019
l[0] = 1

for c in S:
  Sum += int(c) * digits % 2019
  Sum %= 2019
  l[Sum] += 1
  digits = digits * 10 % 2019

for i in range(len(l)):
  ans += l[i] * (l[i] - 1) // 2
  
print(ans)
# Judge status: Accepted
c = [ [0,0,0] for _ in range(3)]
for i in range(3):
  c[i] = list(map(int, input().split()))
for a0 in range(101):
  b0 = c[0][0] - a0
  b1 = c[0][1] - a0
  b2 = c[0][2] - a0
  if (((c[1][0]-b0) == (c[1][1]-b1) == (c[1][2]-b2)) and
      ((c[2][0]-b0) == (c[2][1]-b1) == (c[2][2]-b2))):
    print("Yes")
    break
else:
  print("No")
# Judge status: Wrong Answer
let = input()
li = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(24):
  if li[i] == let:
    print(li[i+1])
    break
# Judge status: Accepted
A, B, T = map(int, input().split())
ans = 0
while T-A >= 0:
  T-= A
  ans += B
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
T = 0

while T != 0:
  N = N // K
  T += 1
  
print(T)
# Judge status: Accepted
import sys
input = sys.stdin.readline

# A - Table Tennis Training
def move_left():
	return A + (B-A-1)//2


def move_right():
	return  N - B + 1 + (B-A-1)//2	


N, A, B = map(int, input().split())

if (B-A) % 2 == 0:
	print(int((B-A)//2))
else:
	l = move_left()
	r = move_right()
	print(min(l, r))
# Judge status: Accepted
# (1,2,3,4,5..,N) + (1,2,3,4,...,N/2) * 2 + (1,2,...,N/3) * 3 + ...+(1,) * N
# 累積和を使うことでO(1)でそれぞれの計算をする．N回ループをするので，合計O(N)の計算量で終了する

N = int(input())

S=[0]*(N+1)
for i in range(1,N+1):
    S[i] = S[i-1] + i

ans = 0
for i in range(1,N+1):
    ind = int(N/i)
    ans += S[ind] * i

print(ans)
# Judge status: Accepted
n = int(input())
As = list(map(int, input().split()))

if n%2 == 0:
    inds = list(range(n-1,0,-2)) + list(range(0,n,2))
else:
    inds = list(range(n-1,-1,-2)) + list(range(1,n,2)) 

Bs = [As[i] for i in inds]
print(*Bs)
# Judge status: Wrong Answer
a,b,c=map(int, input().split())
print((a-b-2*c)//2+1)
# Judge status: Wrong Answer
N = int(input())
s = input()
t = input()
if s==t:
    print(N)
    exit()
s = s[::-1]
cnt = 0
for c1, c2 in zip(s,t):
    if c1 != c2:
        break
    cnt += 1

print(N*2-cnt)
# Judge status: Accepted
import math
A,B = map(int,input().split())

ans = []
for ans in range(1,1251):
    if math.floor(ans*0.08) == A and math.floor(ans*0.1) == B:
        print(ans)
        exit()

print(-1)
# Judge status: Wrong Answer
N,K=map(int,input().split())

r,s,p = map(int,input().split())

T=list(input())
T=''.join(list(reversed(T)))


d={}
for j in range(N):
    if T[j]=='r':
        d[j]=p
    elif T[j]=='s':
        d[j]=r
    else:
        d[j]=s

for i in range(N):
    if i-K in d:
        if d[i]==d[i-K]:
            d[i]=0

score=0

for _,val in d.items():
    score+=val

print(score)
# Judge status: Wrong Answer
C = input()

next = ord('C') + 1
print(chr(next))
# Judge status: Accepted
N = int(input())
data = list(map(int,input().split()))
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if data[i] % 2 == 0:
        sw1 += 1
        if data[i] % 3 == 0 or data[i] % 5 == 0:
            sw2 += 1

if sw1 >= 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Accepted
a, b, c, d = map(int, input().split())

#a<b<c
ba =abs(b-a)
cb =abs(c-b)
ca =abs(c-a)

if ca <= d:
    print("Yes")
elif ba <= d and cb<= d:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x=input()
if x == 0:
 print(1)
else:
 print(0)
# Judge status: Accepted
n,k = map(int,input().split())

d_list = []
a_list = []
for k_tmp in range(k):
    d_tmp=int(input())
    d_list.append(d_tmp)
    a_list_tmp = list(map(int,input().split()))
    a_list.append(a_list_tmp)

ans_set = set()
for i in range(len(a_list)):
    for j in range(len(a_list[i])):
        ans_set.add(a_list[i][j])

print(n - len(ans_set))
# Judge status: Wrong Answer
s = input()
r = s[::-1]
print(s, r)
cnt = 0
for i in range(len(s)):
    if s[i] != r[i]:
        cnt += 1
print(int(cnt / 2))
# Judge status: Accepted
N = int(input())
A = [0] + list(map(int,input().split()))
B = [0] + list(map(int,input().split()))
C = [0] + list(map(int,input().split()))
ans=0
pre = -2
for i in range(1,N+1,1):
    ans += B[A[i]]
    if A[i]-pre == 1:
        ans+=C[pre]
    pre = A[i]
print(ans)
# Judge status: Accepted
a, b, c, d = list(input())
for op1 in ['+', '-']:
    for op2 in ['+', '-']:
        for op3 in ['+', '-']:
            tmp = a + op1 + b + op2 + c + op3 + d
            if eval(tmp) == 7:
                print(tmp+'=7')
                exit()
# Judge status: Accepted


import numpy as np
import fractions as fra


import calendar
def c(n):
    return calendar.monthrange(2019,n)[1]

x,y=map(int,input().split())

if(c(x)==c(y)):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
w_list=[input() for _ in range(n)]

if len(w_list)!=len(set(w_list)):
    print("No")
    exit()

for i in range(1,n):
    if w_list[i-1][-1]!=w_list[i][0]:
        print("No")
        exit()
print("Yes")