peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
A = [int(i)*2 for i in input().split()]

maxa = 0
ai = 0
for i in range(N):
    if A[i] > maxa:
        ai = i
        maxa = A[i]
maxa //= 2

res = 0
mind = 10**18
for i in range(N):
    if i==ai: continue
    d = abs(A[i]-maxa)
    if d < mind:
        mind = d
        res = i

print(maxa, A[res]//2)
# Judge status: Wrong Answer
import sys
C11,C12,C13 = map(int, input().split())
C21,C22,C23 = map(int, input().split())
C31,C32,C33 = map(int, input().split())





if (abs(C11+C22) == abs(C12 - C21)) and (abs(C12+C23) == abs(C13+C22)) and (abs(C22+C33) == abs(C23 + C32)):
    print("Yes")

print("No")
# Judge status: Wrong Answer
n = int(input())
a,b=map(int,input().split())

if a == b:
    if a % n == 0:
        print("OK")
    else:
        print("NG")
else:
    while a <= b:
        a += 1
        if a % n == 0:
            print('OK')
            break
        elif a == b:
            print("NG")
# Judge status: Accepted
s = map(int, input())
t = list(map(int, input().split()))

is_even = True
count = 0

while(is_even):
    for r in t:
        if t[0] % 2 == 0:
            t.append(t[0] // 2)
            t.pop(0)
        else:
            is_even = False
            break
    else:  
        count += 1
        
print(count)
# Judge status: Accepted
import fractions

t = 1
n = int(input())

for i in range(n):
    s = int(input())
    t = t * s // fractions.gcd(t, s)
    
print(t)
# Judge status: Accepted
n = int(input())

def s(n):
    return n * (n + 1) // 2

ans = 0

for i in range(1, n+1):
    tmp = n // i
    ans += i * s(tmp)

print(ans)
# Judge status: Accepted
d,n = map(int,input().split())
case = 100**d
if n < 100:
    print(case*n)
else:
    print(101*case)
# Judge status: Accepted
n,p=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):a[i]%=2
o=a.count(1)
z=n-o
if o==0:
  if p==0:print(2**z)
  else:print(0)
else:
  print(2**(n-1))
# Judge status: Accepted
s = input()
n = len(s)

ans = 753
for i in range(3, n + 1):
    temp = abs(int(s[i-3:i]) - 753)
    if ans > temp:
        ans = temp
print(ans)
# Judge status: Wrong Answer
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if a > b:
    a, b = b, a
    v, w = w, v
    
if a + (v * t) < b + (w * t):
    print('NO')
else:
    print('YES')
# Judge status: Wrong Answer
x, y = map(int, input().split())

import math
p = int(math.log(y//x, 2))
#print(p)

print(p+1)
# Judge status: Accepted
n = int(input())

ans = n + 1
for x in range(1, int(n ** 0.5) + 2):
    if n % x != 0:
        continue
    y = n // x
    ans = min(ans, x + y - 2)
print(ans)
# Judge status: Wrong Answer
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy

path="R"*x+"U"*(y+1)+"L"*x+"D"*(y+2)+"R"*(x+1)+"U"*(y+1)+"L"*(x+2)+"D"*y+"R";

print(path)
# Judge status: Accepted
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)
# Judge status: Accepted
S = input()

rank = []

for i in range(len(S)-2):
    rank.append(abs(int(S[i:i+3])-753))

print(min(rank))
# Judge status: Accepted
from decimal import Decimal

A, B = list(input().split())
A = Decimal(A)
B = Decimal(B)

print(int(A*B))
# Judge status: Accepted
def main():
    s = input()

    n = len(s)
    for i in range(n // 2):
        s = s[:-2]
        if s[0:n//2-i-1] == s[n//2-i-1:n-i*2-2]:
            print(n-i*2-2)
            return

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
from collections import Counter
s = input()
ans = [False if i%2 else True for i in Counter(s).values()]
print(all(ans))
# Judge status: Accepted
a, b, k = map(int, input().split())
for i in range(a, b+1):
    if i < a+k or b-k < i:
        print(i)
# Judge status: Wrong Answer
H, N = map(int, input().split())
da, cost = [0] * N, [0] * N
for i in range(N):
    da[i],cost[i]=map(int, input().split())

max_da=max(da)  
dp = [float("inf") for i in range(H+max_da)]
dp[0]=0

for j in range(N):
    for i in range(H+max_da):
        if i-da[j]>=0:
            dp[i]=min(dp[i],dp[i-da[j]]+cost[j])

ans=0
for i in range(H,H+max_da):
    if type(dp[i])==int:
        ans=dp[i]
        break
print(ans)
# Judge status: Accepted
n = int(input())
t = [int(input()) for _ in range(n)]

def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

ans = 1
for x in t:
    ans = ans * x // gcd(ans, x)
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())

print(n*(n-1)//2 + m*(m-1)//2)
# Judge status: Accepted
K,A,B= map(int,input().split())

ans = 1
if (B-A) <= 2:
  ans += K

else:
  if B - A <=2:
    ans += K
  else:
    ans += A - 1
    if (K-(A-1)) % 2 == 0:
      ans += (((K-(A-1))//2)) * (B - A)
    else:
      ans += (((K-(A-1))//2)) * (B - A) + 1

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

a = n % k
print(min(a, k-a))
# Judge status: Accepted
r,g,b = input().split()
if int(g+b) % 4 == 0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a, b, c, k = map(int, input().split())
ans = 0
if k % 2 == 0:
    ans = a - b
else:
    ans = b - a

if ans > 10 ** 18:
    print("Unfair")
else:
    print(ans)
# Judge status: Accepted
N,M = map(int,input().split())

goto_N = [0]*N
from_1 = [0]*N

for _ in range(M):
    a,b = map(int,input().split())
    if a == 1:
        from_1[b] = 1
    elif b == N:
        goto_N[a] = 1

for i in range(N):
    if goto_N[i] and from_1[i]:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")
# Judge status: Accepted
N,K=map(int,input().split())

ans=1

while True:
  N=N//K
  if N==0:
    break
  ans+=1

print(ans)
# Judge status: Accepted
import bisect
n = int(input())
lis = list(map(int, input().split()))
lis.sort()

mid = (lis[-1] + 1) // 2
p = bisect.bisect_left(lis, mid)
x = abs(lis[p] - mid)
y = abs(lis[p-1] - mid)

if x >= y:
    print(lis[-1], lis[p-1])
else:
    print(lis[-1], lis[p])
# Judge status: Accepted
import sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
dp = [float('INF')]*(N+1)
dp[0] = 0
for i in range(1,N+1):
    dp[i] = dp[i-1]+1
    num6,num9 = 6,9
    while 0<=i-num6<=N:
        dp[i] = min(dp[i],dp[i-num6]+1)
        num6 *= 6
    while 0<=i-num9<=N:
        dp[i] = min(dp[i],dp[i-num9]+1)
        num9 *= 9
print(dp[-1])
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0

for i in range(k, n + 2):
    max = (n - i + 1 + n)*i//2
    min = (i - 1)*i//2
    ans += max - min + 1
    ans %= 10**9 + 7

print(ans)
# Judge status: Wrong Answer
s = input()
if 0 in [s.count("W"),s.count("E")] or 0 in [s.count("N"),s.count("S")]:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
N = int(input())
for i in range(9,0,-1):
    if N//int(str(i)*3)>=1:
        print(str(i+1)*3)
        break
# Judge status: Wrong Answer
n , k = map(int,input().split())
count = 1
origk = k
while(True):
    if n <= k:
        print(count)
        break
    
    k *= origk
    count+=1
# Judge status: Accepted
import sys
import numpy as np


input = sys.stdin.readline
N,W  = map(int,input().split())
dp = np.zeros((N+1,W+1),dtype=int)
w,v = [],[]
for _ in range(N):
    w_,v_ = map(int,input().split())
    w.append(w_)
    v.append(v_)

for row in range(N):
    dp[row+1,:w[row]] = dp[row,:w[row]]
    dp[row+1,w[row]:] = np.maximum(dp[row,w[row]:],v[row]+dp[row,:-w[row]])
print(dp[N,-1])
# Judge status: Accepted
n = int(input())
A = [0] + list(map(int, input().split()))
B = [0]*(n+1)
for i in range(n, 0, -1):
    B[i] =(A[i] + sum(B[::i])) % 2
print(sum(B))
print(*(i for i, b in enumerate(B) if b))
# Judge status: Wrong Answer
x = input()
x = x[::-1]
x = x[0]

if x == 3:
  print('bon')
else:
  if x == 0 or x == 1 or x == 6 or x == 8  :
    print('pon')
  else:
    print('hon')
# Judge status: Wrong Answer
N,X,T=map(int,input().split())
print(T*(N//X+1))
# Judge status: Wrong Answer
li = list(map(int, input().split()))
count = 0
for x in li:
    if x % 2 == 0:
        count += 1
        x = x / 2
    else:
        count = 0
        break
print(count)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print(c - (a - b))
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())
print(N // max(H, W) + 1 if N % max(H, W) == 0 else N // max(H, W))
# Judge status: Accepted
S=input()
pvt=int(len(S)/2)
f=S[:pvt]
b=S[pvt:]
b_sort=b[::-1]
ans=0
for i, j in zip(f,b_sort):
    if i != j:
        ans += 1
print(ans)
# Judge status: Accepted
x = int(input())
s = input()
li = [0]
c = 0
for i in range(x):
    if s[i] == "I":
        c += 1
        li.append(c)
    else:
        c -= 1
        li.append(c)
print(max(li))
# Judge status: Accepted
n=int(input())

for x in range(55000):
    if int(x*1.08)==n:
        print(x)
        exit()
print(":(")
# Judge status: Wrong Answer
x = int(input())

b = x//1.08
x1 = int(b*1.08)
x2 = int((b+1)*1.08)

if x1 == x:
  print(b)
elif x2 == x:
  print(b+1)
else:
  print(":(")
# Judge status: Wrong Answer
def main():
  N = input()
  operators = [["+","+","+"],["+","+","-"],["+","-","+"],["-","+","+"],["+","-","-"],["-","+","+"],["-","-","+"],["-","-","-"]]
  for x,y,z in operators:
        tmp = N[0]+x+N[1]+y+N[2]+z+N[3]
        if eval(tmp) == 7:
              print(tmp+"=7")
              break

if __name__ == "__main__":
      main()
# Judge status: Accepted
x,y = map(int,input().split())
if x%y == 0 :
    print(-1)
else:
    for i in range(10000):
        if (x*i)%y != 0:
            print(x*i)
            break
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int, input().split()))

p.sort()
print(sum(p[0:k]))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

p = 0
for i in range(1, N):
    p ^= A[i]
print(p)

ans = [str(p)]
for i in range(1, N):
    t = A[i-1] ^ A[i]
    p = p ^ t
    ans.append(str(p))
print(" ".join(ans))
# Judge status: Accepted
N = int(input())

a_li = list(map(int, input().split()))

num_0, num_2, num_4 = 0, 0, 0

for i in a_li:
    if i % 4 == 0:
        num_4 += 1
    elif i % 2 == 0:
        num_2 += 1
    else:
        num_0 += 1

if num_0 <= num_4 or (num_0 == num_4 + 1 and num_2 == 0):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0
for i in range(N):
  if a[i] <= x:
    cnt += 1
    x -= a[i]
  else:
    break
if x > 0:
  cnt -= 1
print(cnt)
# Judge status: Wrong Answer
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

enemyHp.sort()
print(enemyHp)
resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0


for i in range(resultEnemyCount):
    countNormal += int(enemyHp[i])

print(countNormal)
# Judge status: Accepted
icase=0    
if icase==0:
    x,a,b=map(int,input().split())
    if b-a<=0:    
        print("delicious")
    elif b-a<=x:    
        print("safe")
    else:
        print("dangerous")
# Judge status: Accepted
_ = input()
P = [int(i) for i in input().split()]

vmin = max(P)
vmax = 0

cnt = 0
for p in P:
  if p <= vmin:
    cnt += 1
  if p < vmin:
    vmin = p
  if vmax < p:
    vmax = p
    
print(cnt)
# Judge status: Wrong Answer
N=int(input())
if N<1000:
    print('ABC',N)
else:
    print('ABD',N-999)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
#print(a)
b = [0]*(N)

for i in range(N, 0, -1):
    to = 0
    #print(i)

    for j in range(i-1, N ,i):
        to += b[j]

    if to%2 != a[i-1]:
        b[i-1] = 1
    #print(b)
if sum(b)==0:
    print(0)

else:
    print(sum(b))
    ans = str()
    for i in range(N):
        if b[i]:
            ans += str(i+1)+" "
    print(ans)
# Judge status: Accepted
a, b, c = input().split()
print(c +' '+a+' '+b)
# Judge status: Accepted
# coding: utf-8

def run():
    N, M = map(int, input().split())
    left1 = 1
    left2 = M
    right1 = N -M
    right2 = N
    for idx, i in enumerate((range(1,M,2))):
        print('{} {}'.format(left1+idx, left2-idx))
    for idx, _ in enumerate(range(M+1, 2*M+1, 2)):
        print('{} {}'.format(right1+idx, right2-idx))

if __name__ == "__main__":
    run()
# Judge status: Wrong Answer
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1

checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
rest = 8 - num

if (rest > check[8]):
    more = num + check[8]
    more = min(8, more)
else:

    more = 8


print(num, more)
# Judge status: Accepted
x = int(input())
money = 100
year = 0

for i in range(1, (10**18)):
    #print(i)
    money = int(money*1.01)
    if money >= x:
        year = i
        break

print(year)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1, n-1):
    if sorted([p[i-1], p[i],p[i+1]])[1] == p[i] : 
        ans += 1
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

lac = [0] * n
lwa = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if lac[p] == 0:
        if s == 'WA':
            lwa[p] += 1
        if s == 'AC':
            lac[p] = 1

print(sum(lac), sum(x * y for x, y in zip(lac, lwa)))
# Judge status: Wrong Answer
from collections import deque
import copy
m=int(input())
a=list(map(int, input().split()))
a.sort()

li= []
li.append(a[0])
for i in range(1,len(a)):
    if all(a[i]%j != 0 for j in li) or li == []:
        li.append(a[i])
    elif not all(a[i] != j for j in li):
        li.remove(a[i])


print(len(li))
# Judge status: Wrong Answer
import sys
import numpy as np
from math import ceil, floor


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    A = nl()
    A = np.array(list(map(lambda x: A[x] - (x + 1), range(n))))
    ave = np.mean(A)
    print(min(np.sum(np.abs(A - ceil(ave))), np.sum(np.abs(A - floor(ave)))))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, M, K = map(int, input().split())

for i in range(N+1):
    for j in range(M+1):
        if((M-i)*j+(N-j)*i ==K):
            print("Yes")
            exit()
else:
    print("No")
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
tmp = sum(A)
root = 0
ans = 0
for i in range(N+1):
    if i==0:
        mx = 1
    else:
        mx = root*2
    if A[i] > mx:
        ans = -1
        break
    root = min(tmp, mx) - A[i]
    tmp -= A[i]
    ans += root + A[i]

print(ans)
# Judge status: Accepted
def main():
    length = int(input())
    numbers = list(map(int, input().split()))
    answer = [0] * length
    if length % 2:
        answer[:length // 2 + 1] = numbers[::-2]
        answer[length // 2 + 1:] = numbers[1::2]
    else:
        answer[:length // 2] = numbers[::-2]
        answer[length // 2:] = numbers[::2]
    print(" ".join(list(map(str, answer))))


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = input().split(' ')
a = int(a)
b = int(b)
if (a<=0 and b>=0) or a==0 or b==0:
  print('Zero')
elif a>0 and b>0:
  print('Positive')
else:
  X = (abs(a) - abs(b))
  if X%2 == 0:
    print('Negative')
  else:
    print('Positive')
# Judge status: Accepted
from collections import Counter
n = int(input())
A = list(map(int,input().split()))
c = Counter(A)
for i in range(1, n+1):
    print(c[i])
# Judge status: Wrong Answer
k,a,b = map(int,input().split())
cokie = 1
if b < a:
    cokie += k
    print(cokie)
else:
    if k < a+2 or b-a < 2:
        cokie += k
        print(cokie)
    else:
        cokie += a-1
        k -= a-1
        b_a = k//2
        hit = k%2
        cokie += b_a*(b-a) + hit 
        print(cokie)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())

m = max(h,w)

if n % m == 0:
    print(n//m)
else:
    print(n//m+1)
# Judge status: Accepted
S = input()
T = input()

ans = len(T)

for offset in range(len(S) - len(T) + 1):
    ans_offset = 0
    for i in range(len(T)):
        if T[i] != S[offset + i]:
            ans_offset += 1

    ans = min(ans, ans_offset)

print(ans)
# Judge status: Wrong Answer
count = int(input())

data = list(map(int,input().split()))

total = 0

for i in range(count):
    a =data.count(i + 1)
    print(a)
    if total + a+1 == count:
        print("0 \n" *(count - i))
# Judge status: Accepted
s=input()
t=input()
ans=10000
for i in range(len(s)-len(t)+1):
    tmp=0
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            tmp+=1
    ans=min(ans,tmp)
print(ans)
# Judge status: Accepted
import math

a,b=map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

count=0

if a>=2:
    count+=combinations_count(a,2)

if b>2:
    count+=combinations_count(b,2)

print(count)
# Judge status: Wrong Answer
n,m = map(int,input().split())
i_now = []
r_now = []

for k in range(m):
  i,r = map(int,input().split())
  
  i_now.append(i)
  r_now.append(r)

i_max = max(i_now)
r_min = min(r_now)

ans = r_min - i_max + 1
  
print(ans)
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
if a > b:
    print(0)
elif n < (b-a+1) or (a-b==0 and n > 1):
    print(0)
else:
    diff = b-a+1
    ans = (diff**(n-2))//2+1
    print(int(ans))
# Judge status: Accepted
import math
X=int(input())
moto=100
count=0
while True:
    count+=1
    moto=math.floor(1.01*moto)
    if moto>=X:
        break
print(count)
# Judge status: Accepted
N = int(input())
pos_list = []
for _ in range(N):
    X, L = map(int, input().split())
    pos_list.append([X + L, X - L])
sorted_data = sorted(pos_list)
# print(pos_list)
ans = 0
current = -(10 ** 9)
for val in sorted_data:
    if current <= val[1]:
        ans += 1
        current = val[0]
print(ans)
# Judge status: Accepted
N,K=list(map(int,input().split()))
P=list(map(int,input().split()))

E_P=[(1+p)/2 for p in P] 

E_P_sum=[0]
E_P_sum_=0
for n in range(N):
    E_P_sum_=E_P_sum_+E_P[n]
    E_P_sum.append(E_P_sum_)

max_ = 0
for k_ in range(len(P)-K+1):
    sum_=E_P_sum[k_+K]-E_P_sum[k_]
#     print(E_P_sum[k_+K],E_P_sum[k_],sum_)
    if max_ < sum_:
        max_=sum_
        
print(max_)
# Judge status: Accepted
n,c,k=map(int,input().split())
t=[int(input()) for _ in range(n)]+[10**10]
t.sort()
b=1
p=0
if c==1:
  print(n)
  exit()
while p<n:
  l=t[p]+k
  pp=1
  f=1
  while pp<c and f:
    p+=1
    if t[p]<=l:
      pp+=1
      if pp==c:
        p+=1
    else:
      f=0
  if p<n:
    b+=1
print(b)
# Judge status: Accepted
n = int(input())
ans = 0

if n%2 == 1:
    print(0)
else:
    n //= 2
    while n > 0:
        ans += n//5
        n //= 5
    print(ans)
# Judge status: Accepted
s = list(input())

for i in range(1,len(s)):
    if s[i] != "9":
        print(int(s[0])-1+9*(len(s)-1))
        exit()
print(int(s[0])+9*(len(s)-1))
# Judge status: Accepted
ans = 0
for i in range(1, int(input()) + 1):
    if not (i  % 3 == 0 or i % 5 == 0):
        ans = ans + i
print(ans)
# Judge status: Accepted
from fractions import gcd
n=int(input())
a=list(map(int, input().split()))

leftgcd=[0]*n
leftgcd[0]=a[0]
for i in range(1,n):
	leftgcd[i]=gcd(leftgcd[i-1],a[i])

rightgcd=[0]*n
rightgcd[n-1]=a[n-1]
for i in reversed(range(0,n-1)):
	rightgcd[i]=gcd(rightgcd[i+1],a[i])

ans=rightgcd[1]
for i in range(1,n-1):
	ans=max(ans,gcd(leftgcd[i-1],rightgcd[i+1]))
print(max(ans,leftgcd[n-2]))
# Judge status: Wrong Answer

n=input()

k=len(n)
if k>=5:
    print(9+900+int(n)-10000)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100+1)
elif k==2:
    print(9)
else:
    print(int(n))
# Judge status: Wrong Answer
x = input()
y = x.isupper
if (y == True):
  print("A")
else:
  print("a")
# Judge status: Wrong Answer
#!/usr/bin/env python
# coding: utf-8

# In[12]:


X = input()


# In[15]:


mylist = X
while "ST" in mylist:
    if mylist == "ST":
        mylist = ""
    else:
        idx = X.index("ST")
        mylist = mylist[:idx] + mylist[idx+2:]
print(len(mylist))


# In[ ]:
# Judge status: Accepted
k=int(input())
a,b=[int(i) for i in input().split()]
ans=0
for i in range(a,b+1):
    if i%k==0:
        ans+=1
if ans==0:
    print("NG")
else:
    print("OK")
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if A + B <= C:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from math import factorial as f
S = int(input())

ans, MOD, N = 0, 1000000007, S // 3

if N == 0:
  print(0)
  exit()

for i in range(1, N+1):
  S -= 3
  if i == 1:
    ans += 1
    continue
  ans += f(S + i - 1)

print(ans % MOD)
# Judge status: Accepted
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import gcd
    input = sys.stdin.readline

    x = int(input())
    print(360 // gcd(360, x))
    

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c=input().split()
b,a=a,b
c,a=a,c
print(a,b,c)
# Judge status: Accepted
X = int(input())

h = (X // 500)*1000 + ((X-500 * (X//500)) // 5) *5

print(h)
# Judge status: Accepted
import heapq
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
day = {i+1:[] for i in range(M)}
for a, b in ab:
  if a <= M:
    day[a] += [-b]

q = []
ans = 0
for i in range(M):
  for b in day[i+1]:
    heapq.heappush(q, b)
  if len(q) > 0:
    ans += -1 * heapq.heappop(q)
print(ans)
# Judge status: Wrong Answer
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)
# Judge status: Wrong Answer
S = input()
diff = 1000
for i in range(len(S)-2):
    diff2 = abs(int(S[i:i+3])-753)
    if diff2 < diff:
        diff = diff2
# Judge status: Accepted
n = list(map(int,input().split()))

n.sort(reverse = True)

if n[0] == n[1]+n[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys

S = input()

if len(S) % 2 != 0:
    print('No')
else:
    for i in range(0, len(S), 2):
        if S[i] != 'h' or S[i + 1] != 'i':
            print('No')
            sys.exit()
    print('Yes')
# Judge status: Wrong Answer
def main():
    N = int(input())
    A = []
    c = 1
    m = int(input())
    for _ in range(N-1):
        a = int(input())
        if a < m:
            m = a
            c += 1
    print(c)
main()
# Judge status: Accepted
c=str(input())
if c=='a' or c=='e' or c=='i' or c=='o' or c=='u':
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
x, a, b = map(int, input().split())

a *= -1

a += b

if a <= 0:
    print("delicious")
elif a <= x:
    print("safe")
else:
    print("dangerous")
# Judge status: Wrong Answer
s = sorted(set(input()))
if len(s)==26:
    print('None')
else:
    for i in range(25):
        if s.count(chr(ord('a')+i))==0:
            print(chr(ord('a')+i))
            break
# Judge status: Accepted
from sys import stdin
from sys import exit
def main():
    #入力
    readline=stdin.readline
    n=int(readline())

    if n%2==1:
        print(0)
        exit()
    
    n//=2
    ans=0
    x=5
    while n//x>=1:
        ans+=n//x
        x*=5

    print(ans)

if __name__=="__main__":
    main()
# Judge status: Accepted
N,A = list(map(int,input().split()))
listA = list(map(int,input().split()))
listB = []
if N >= len(listA):
    print(0)
    exit()
listA.sort()
max_n = listA[-1] - listA[0]
for i in range(A-1):
    listB.append(listA[i+1]-listA[i])
listB.sort(reverse=True)
max_n -= sum(listB[:N-1])
print(max_n)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

c = [a[i]-i-1 for i in range(n)]
ans = 0
c.sort()
#print(c)
if n%2 == 1:
    b = c[n//2]
    for i in range(n):
        ans += abs(c[i]-b)
else:
    b = (c[n//2]+c[n//2-1])//2
    #print(b)
    for i in range(n):
        ans += abs(c[i]-b)
print(ans)