peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n,k = (int(x) for x in input().split())
input()
ans = n // (k-1)
print(ans)
# Judge status: Accepted
def solve(N):
    M = 10**9+7
    DP = [0 for _ in range(N+1)]
    DP[0] = 1
    for n in range(N+1):
        for i in range(3,n+1):
            DP[n] += DP[n-i]
            DP[n] %= M

    return DP[N]

def main():
    S = int(input())
    print(solve(S))

if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

mod = 1000000007


ans = 0
n = A[0]
for a in A[1:]:
    ans += a * n
    n += a

print(ans%mod)
# Judge status: Wrong Answer
w, h, n = [int(x) for x in input().split()]
S = [0,w,0,h]

for i in range(n):
    x, y, a = [int(_) for _ in input().split()]

    if a == 1:
        S[0] = max(S[0], x)        
    if a == 2:
        S[1] = min(S[1], x)
    if a == 3:
        S[2] = max(S[2], y)        
    if a == 4:
        S[3] = min(S[3], y)

ans = max(0,(S[1] - S[0]) * (S[3] - S[2]))
print(ans)
# Judge status: Accepted
N,A,B=map(int,input().split(' '))
answer = 0
for i in range(N):
  n = sum(int(j) for j in str(i+1))
  if n >= A and n <= B:
    answer += i+1
print(answer)
# Judge status: Wrong Answer
import collections

def myindex(l, x, default=-1):
    if x in l:
        return l.index(x)
    else:
        return default

def main():
    N = int(input())
    a = list(map(int, input().split()))
    
    A = [x//400 for x in a]
    A.sort()
    Aitems = list(zip(*collections.Counter(A).items()))
    cntmin = len([x for x in Aitems[0] if x < 8])
    cntmax = cntmin + len([x for x in A if x >= 8])
    print(cntmin, cntmax)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import fractions
 
data = input().split()
val = [int(n) for n in data]
 
res = val[0] * val[1] / fractions.gcd(val[0], val[1])
 
print(int(res))
# Judge status: Accepted
import fractions
A,B=map(int,input().split())
print(int(A*B/fractions.gcd(A,B)))
# Judge status: Wrong Answer
import copy
n,k=list(map(int,input().split()))
A=list(map(int,input().split()))
if max(A)==0:
  ans1=[0]*n
  print(' '.join(map(str, ans1)))
  exit()
if k>=n-1:
  ans2=[n]*n
  print(' '.join(map(str, ans2)))
  exit()

for c in range(k):
  B=[0]*len(A)
  for i in range(1,len(A)+1):#1~N
    for j in range(i-A[i-1],i+A[i-1]+1):
      if j>0 and j<=len(A):
        B[j-1]+=1#0~N-1
  A=copy.deepcopy(B)
print(' '.join(map(str, A)))
# Judge status: Accepted
#coding:utf-8
import itertools

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

ansN = len(list(itertools.combinations(range(N), 2)))
ansM = len(list(itertools.combinations(range(M), 2)))

ans = ansN + ansM
print(ans)
# Judge status: Accepted
n, d = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
p = []
cnt = 0
for j in range(n):
    for k in range(n):
        if j != k:
            wa = 0
            for t in range(d):
                wa += (l[j][t] - l[k][t]) ** 2
                #print(wa)
            if wa ** (1 / 2) % 1 == 0:
                cnt += 1
                
print(int(cnt / 2))
# Judge status: Accepted
S = input()
K = int(input())
n = 0
if K <= len(S) and all([s == '1' for s in S[:K]]):
  print('1')
else:
  for s in S:
    if s != '1':
      print(s)
      exit()
# Judge status: Accepted
N, *A = map(int, open(0).read().split())

result = 0
p = A[0]
for i in range(1, N):
    if p >= A[i]:
        result += p - A[i]
    else:
        p = A[i]
print(result)
# Judge status: Wrong Answer
i=int(input())

print((i//500)*1000+(i-(i//500*500)//5*5))
# Judge status: Accepted
# -*- coding : utf-8 -*- 

w,h,n = map(int, input().split())


l,r,u,d = 0,w,h,0
for i in range(n) :
  x,y,a = map(int, input().split())
  if a == 1:
    l = max(l,x)
  elif a == 2:
    r = min(r,x)
  elif a == 3:
    d = max(d,y)
  elif a == 4:
    u = min(u,y)
  
S = max(0, u-d) * max(0,r-l)
print(int(S))
# Judge status: Accepted
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
         count += 1
print(count)
# Judge status: Accepted
import collections
N  = int (input())
nums = list(map(int,input().split(" ")))
MOD = 998244353
di = collections.defaultdict(lambda :0)
for num in nums:
    di[num] += 1


ans = 1 if nums[0] == 0 else 1
ans = 0 if 0 in nums[1:]  else 1
bottom = min(nums)
top= max(nums)
for d in range(1,top + 1):
    ans *= pow(di[d - 1] ,di[d ],MOD)


print(ans % MOD)
# Judge status: Wrong Answer
firstline = int(input())
sec = input()
maxN = 0
init = 0

for i in sec:
  if i == "I":
    init -= 1
  else:
    init += 1
  if init > maxN:
    maxN = init
    
print(maxN)
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
ans = 0
if (b-a)%x==0:
    print((b-a)//x + 1)
elif b-a==0:
    print(0)
else:
    print((b-a)//x)
# Judge status: Wrong Answer
A, B = map(int, input().split())
if A <= 5:
  print(0)
elif A <= 12:
  print(B/2)
else:
  print(B)
# Judge status: Accepted
L, R, d = map(int, input().split())
ans = []

for i in range(L,R+1):
    if (i%d == 0):
        ans.append(i)
print(len(ans))
# Judge status: Accepted
n=input()
if n[0]==n[1]==n[2]:
    print(n)
elif int(n)<int(n[0]*3):
    print(n[0]*3)
else:
    s=str(int(n[0])+1)
    print(s*3)
# Judge status: Accepted
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print("red")
# Judge status: Wrong Answer
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
d = v*2 - w*2
if d > 0:
    s = abs(b-a)
    f = abs(v-w)
    if f*(t-1)-s <= d:
        print('YES')
    else:
        print('NO')
else:
    print('NO')
# Judge status: Wrong Answer
N = int(input())

for n in range(N):
    if n*n <= N: ans = n*n
    else: break
print(ans)
# Judge status: Accepted
def resolve():
    a, b, c, d = map(int, input().split())
    w = a*c
    x = a*d
    y = b*c
    z = b*d
    ans = max(w, x, y, z)
    print(ans)

resolve()
# Judge status: Wrong Answer
import math
N = int(input())
n_max = int(math.sqrt(N))
a = []
for i in range(1,n_max):
  if N % i == 0:
    a.append(i)
ans = 2 * N
for i in a:
  if (i + (N // i) - 2) < ans:
    ans = i + (N // i) - 2
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
s = [sum(a)] * (n + 1)
now = 0
for i in range(n + 1):
    now += a[i]
    s[i] -= now
ans = 0
now = 1
for ai, si in zip(a, s):
    ans += now
    now -= ai
    if now < 0:
        print(-1)
        exit()
    now = min(now * 2, si)
print(ans)
# Judge status: Accepted
n = int(input())

for i in range(1,10):
  for j in range(1,10):
    if n == i*j:
      print("Yes")
      exit(0)
      
print("No")
# Judge status: Wrong Answer
from decimal import Decimal, getcontext
a, b, c = map(int, input().split())
getcontext().prec = 35000
if Decimal(a).sqrt()+Decimal(b).sqrt()<Decimal(c).sqrt():
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n,d=map(int,input().split())

print(n//(d*2)+1)
# Judge status: Accepted
N = int(input())

count = 0
dict = {}
for i in range(N):
    s = ''.join(sorted(input()))
    if(s in dict):
        dict[s] += 1
        count += dict[s]
    else:
        dict[s] = 0
print(count)
# Judge status: Wrong Answer
N, K, S = map(int, input().split())

MAX = 10 ** 9
if S == MAX:
    A = [1] * N
else:
    A = [MAX] * N

for i in range(0, N, 2):
    A[i] = S
    K -= 1
    if K == 0:
        break

print(*A)
# Judge status: Accepted
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = input()

score = {"s":R, "p":S, "r":P}

ans = 0
for i in range(K):
    j = i
    tmp = ""
    while j <N:
        if tmp != T[j]:
            ans += score[T[j]]
            tmp = T[j]
        else:
            tmp = ""
        j += K

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

a = list(set(A))
a_c = {}
for v in A:
  if v in a_c:
    a_c[v] += 1
  else:
    a_c[v] = 1

def cmb(n):
  if n < 2: return 0
  else:
    return n * (n-1)//2

S = 0
for k in a_c:
  S += cmb(a_c[k])

for i in range(N):
  print(S - cmb(a_c[A[i]]) + cmb(a_c[A[i]]-1))
# Judge status: Accepted
n, k = map(int, input().split())

if n % k == 0:
  print(0)
else: 
  ans = n % k
  #print(ans)
  while ans > k//2:
    n = abs(ans - k)
    ans = min(n, ans)
  print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
SUM = sum(a)
cnt = 0
l = []
for i in range(n):
    cnt += a[i]
    l.append(abs(cnt - (SUM - cnt)))
print(min(l))
# Judge status: Accepted
N = int(input())

dp = [10 ** 9] * 100001
dp[0] = 1

for i in range(N):
    if dp[i] > 0:
        dp[i + 1] = min(dp[i] + 1, dp[i + 1])
        for j in range(1, 7):
            if 6 ** j + i <= N:
                dp[i + 6 ** j] = min(dp[i] + 1, dp[i + 6 ** j])
            if 9 ** j + i <= N:
                dp[i + 9 ** j] = min(dp[i] + 1, dp[i + 9 ** j])

print(dp[N] - 1)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a):
  for j in range(b):
    for k in range(c):
      if 500*i+100*j+50*k == x:
        ans += 1

print(ans)
# Judge status: Accepted
n,p = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    if a%2==0: cnt += 1
if n == cnt:
    if p == 0: ans = 2**n
    else: ans = 0
else: ans = 2**(n-1)
print(ans)
# Judge status: Wrong Answer
O=input()
E=input()
print(*[o+e for o,e in zip(O,E)], sep="")
# Judge status: Accepted
import math
n = int(input())

power = math.factorial(n)
print(power%(10**9+7))
# Judge status: Accepted
# coding: utf-8

#A,B = input().split()
A,B,C = map(int, input().split())
K = int(input())

cnt=0
while 1:
    if not A<B:
        B=B*2
        cnt+=1
    else:
        break
    
while 1:
    if not B<C:
        C=C*2
        cnt+=1
    else:
        break
    
if cnt>K:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
H , A = (int(x) for x in input().split())
count = 0

while H > 0:
    H = H - A
    count += 1


print(count)
# Judge status: Wrong Answer
cand_num, tenka = map(int, input().split(" "))
candles = list(map(int, input().split(" ")))
mini = 10 ** 8

for i in range(cand_num - tenka + 1):
    if candles[i] * candles[tenka + i - 1] >= 0:
        temp = max(abs(candles[i]), abs(candles[tenka + i - 1]))
    else:
        temp = min(abs(candles[i]), abs(candles[tenka + i- 1])) * 2 + max(abs(candles[i]), abs(candles[tenka + i - 1]))
    mini = temp if mini > temp else mini
print(mini)
# Judge status: Wrong Answer
a = int(input())
ma = a
mi = a
for i in range(4):
  x = int(input())
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi < int(input()):
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
x = int(input())

point_500 = 1000
point_5 = 5

num_500 = x // 500
x = x % 500
num_5 = x // 5

ans = num_500 * point_500 + num_5 * point_5
print(ans)
# Judge status: Accepted
s = input()
t = input()

s_len = len(s)
t_len = len(t)
count = 0
c_min = 1000

for i in range(s_len - t_len + 1):
    count = 0
    for j in range(t_len):
        if s[i + j] == t[j]:
            continue
        count += 1
    if c_min > count:
        c_min = count

print(c_min)
# Judge status: Wrong Answer
import math

N = int(input())

cnt = 3
if N > 3:
    for i in range(1,N-1):
        A = N-i
        rA = math.sqrt(A)
        intA = math.floor(rA)
        if rA == intA:
            cnt -= 1
        if intA == 1:
            cnt += 1
        else:
            for j in range(1,intA+1):
                if A%j == 0:
                    cnt += 2

print(cnt)
# Judge status: Accepted
import sys

N = int(input())
Ai = map(lambda x:int(x),input().split(" "))
 
def f(arg_list):
    even_arg_list = []
    for i in arg_list:
        if i % 2 == 0:
            even_arg_list.append(i/2)
        else:
            return False
    return even_arg_list


counter = 0
while True:
    Ai = f(Ai)
    if Ai == False:
        print(counter)
        sys.exit()
    counter+=1
    # print(Ai)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

#累積和
sumA = [0]*(N+1)
sumB = [0]*(N+1)
for i in range(N):
    sumA[i+1] = A[i] + sumA[i]
    sumB[i+1] = B[i] + sumB[i]

ncandy = 0
for i in range(1, N+1):
    nsum = sumA[i] + (sumB[N] - sumB[i-1])
    if ncandy < nsum:
        ncandy = nsum

print(ncandy)
# Judge status: Accepted
k,n,*a_l = map(int, open(0).read().split())
a_before = 0
del_a = k-a_l[-1] + a_l[0]
for a in a_l:
    del_a = max(del_a, a - a_before)
    a_before = a
print(k - del_a)
# Judge status: Wrong Answer
a, b = map(int,input().split())
for i in range(a, 10001, 1):
    for j in range(b, 10001, 1):
        m = (i*j)/2
        if isinstance(m, int):
            print("EVEN")
            break   
        else:
            print("Odd")
# Judge status: Accepted
N = int(input())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
A.reverse()
B.reverse()
ans = 0
for a,b in zip(A,B):
    a += ans
    x = a % b
    if x != 0:
        ans += b - x
print(ans)
# Judge status: Accepted
N = int(input())

ans = ""

while N > 0:
    N -= 1
    ans += chr(97 + N%26)
    N = N // 26

print(ans[::-1])
# Judge status: Accepted
N = int(input())
if N == 1:
    print(0)
    exit()
ans = (1+(N-1))*(N-1)//2
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
A, B = map(int, input().split())

if A == B:
    print('Draw')
elif A == 1:
    print('Alice')
elif B == 1:
    print('Bob')
elif A > B:
    print('Alice')
else:
    print('Bob')
# Judge status: Wrong Answer
import collections as c

n = int(input())
co = c.Counter(list(map(int, input().split())))
cm = co.most_common()
a = 0
b = 0
for v,m in cm:
  if m >= 4:
    a = b = v
    break
  elif m >= 2 and a == 0:
    a = v
  elif m >= 2 and a != 0:
    b = v
    break
print(a*b)
# Judge status: Accepted
import heapq

n, m = map(int, input().split())
work = [[] for _ in range(10**5 + 1)]
for i in range(n):
    a, b = map(int, input().split())
    work[a].append(b)

total = 0
candidates = []
for d in range(1, m+1):
    for w in work[d]:
        heapq.heappush(candidates, -w)
    if len(candidates) > 0:
        total += -heapq.heappop(candidates)
print(total)
# Judge status: Wrong Answer
import bisect

N,Q = map(int, input().split())
S = list(input())

AC_list = list()

for i in range(1,N):
  if S[i] == "C" and S[i-1] == "A":  
    AC_list.append(i-1)

#print(AC_list)  
  
for i in range(Q):
  l,r = map(int, input().split())
  index_left = bisect.bisect_left(AC_list, l)
  index_right = bisect.bisect_left(AC_list, r-1)
  #print(index_left,index_right)
  if index_right - index_left == 0:
    print(0)
  else:
    print(1+index_right - index_left)
# Judge status: Accepted
H,N = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
ab = min(AB,key = lambda x:x[1])
INF = float('inf')
dp = [INF]*(H+1)
mi_a = ab[0]
mi_b = ab[1]
dp[0] = 0
for i in range(1,H+1):
  if i<=mi_a:
    dp[i]=mi_b
  else:
    for k in AB:
      a = k[0]
      b = k[1]
      tmp = max(0,i-a)
      dp[i] = min(dp[i],dp[tmp]+b)
    
print(dp[H])
# Judge status: Wrong Answer
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if 6 <= val <= N:
        lst[val-1] += 1
print(*lst[1:],sep="\n")
# Judge status: Accepted
#A = list(map(int, input().split()))
a, b, c = map(int, input().split())
k = int(input())
import math

if a >= b:
  p = int(math.log(a/b,2)) +1
else:
  p = 0
  
if b*(2**p) >= c:
  q = int(math.log(b*(2**p)/c,2)) +1
else:
  q = 0
#print(p)
#print(q)

if (p + q) <= k:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n,x=map(int,input().split())
l=list(map(int,input().split()))
cnt=1
d=0
for i in range(n):
    d+=l[i]
    if d<=x:
        cnt+=1
print(cnt)
# Judge status: Accepted
N, K = map(int, input().split())
h = list(map(int,input().split()))

dp = [float('inf')]*N

dp[0] = 0

for i in range(1,N):
    k = 1
    while(i-k >= 0):
        dp[i] = min(dp[i], dp[i-k]+abs(h[i]-h[i-k]))
        if k == K:
            break
        if k < K:
            k += 1

print(dp[N-1])
# Judge status: Accepted
n,m=map(int,input().split())
l=[0]*n
for i in range(m):
    p,q=map(int,input().split())
    l[p-1]+=1
    l[q-1]+=1
print(*l,sep='\n')
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

r1 = []
for j in range(N):
	if T[j] == 'r':
		r1.append(P)
	elif T[j] == 's':
		r1.append(R)
	else:
		r1.append(S)
r2 = []
for i1 in range(K):
  r2.append(r1[i1])
  
for i in range(K,N):
	if r1[i] == r1[i - K]:
		if r2[i-K] == 0:
			r2.append(r1[i])
		else:
			r2.append(0)
	else:
		r2.append(r1[i])

print(sum(r2))
# Judge status: Accepted
s = list(map(int, input().split()))
tar = [5,7,5]
for a in s:
    for b in tar:
        if a == b:
            tar.remove(b)
            break
if tar == []:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
x = list(map(int, input().split()))
w = tuple(x)
x.sort()
if x[(n//2)-1] == x[n//2]:
    for i in range(n):
        print(x[n//2])
else:
    for h in w:
        if h <= x[(n//2)-1]:
            print(x[n//2])
        else:
            print(x[(n//2)-1])
# Judge status: Accepted
n, m, k = map(int, input().split())
l = lambda a, b: a * m + b * n - 2 * a * b
for n_ in range(n+1):
    for m_ in range(m+1):
        if l(n_, m_) == k:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
# ABC140 D
N,K=map(int,input().split())
S=input()

s=''
happy=0
for i in range(N):
    if s==S[i]:
        happy+=1
    s=S[i]
print(min(happy+2*K,N-1))
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int,input().split()))

li = collections.Counter(a)

li2 = [i for i in li.values()]

if max(li2)==1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N, M = map(int, input().split())
left = []
right = []
for i in range(M):
  a, b = map(int, input().split())
  if a == 1:
    left.append(b)
  elif b == N:
    right.append(a)
    
flag = False
left = set(left)
for r in right:
  if r in left:
    flag = True
    break
    
if flag:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
# Judge status: Accepted
N, A, B = map(int, input().split())

MIN = A * (N - 1) + B
MAX = B * (N - 1) + A

print (max(0, MAX - MIN + 1))
# Judge status: Accepted
import heapq
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(N)]

AB.sort(reverse=True)
works=[]
heapq.heapify(works)
ans=0
for i in range(1,M+1):
  day=M-i
  latest=i
  while AB and AB[-1][0]<=latest:
    a,b=AB.pop(-1)
    heapq.heappush(works,-b)
  if not works:
    continue
  ans-=heapq.heappop(works)

print(ans)
# Judge status: Accepted
S=input()
S=S.replace("7","8",1)
print(S)
# Judge status: Wrong Answer
a, b = map(int, input().split())
 
if b > 12:
    print(a)
else:
    print(b)
# Judge status: Accepted
s = input()
a = len(s)

l = ["x"] * a
print("".join(l))
# Judge status: Wrong Answer
N = int(input())
T,A =map(int, input().split())
H = list(map(int, input().split()))
dif = [(A-i) for i in [float(T-h*0.006) for h in H]]
dif_min = dif.index(min(dif))
print(dif_min+1)
# Judge status: Wrong Answer
import math

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

rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]

if rangeA[0] <= rangeB[0]:
  if rangeB[0] <= rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
else:  # rangeA[0] > rangeB[0]
  if rangeA[0] <= rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
print(-1)
# Judge status: Accepted
n,k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
m = a.index(1)
ans = 0
a = m//(k-1)
ans += a+1
s = (k-1-m%(k-1))+m
l = n-1-s
if l!=0:
  ans += (l-1)//(k-1)+1
if m == 0:
  ans = (n-2)//(k-1)+1
if n==k:
  ans = 1
print(ans)
# Judge status: Accepted
s = input()
t = input()
x = []
y = []
for i in range(len(s)):
    if s[i] not in x:
        x.append(s[i])
    if t[i] not in y:
        y.append(t[i])
for i in range(len(x)):
    s = s.replace(x[i], str(i))
for i in range(len(y)):
    t = t.replace(y[i], str(i))
if s == t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N=int(input()[-1])
if N==3:
    print('bon')
elif N in [0,1,6,8]:
    print('pon')
else:
    print('hon')
# Judge status: Accepted
N,M=map(int,input().split())
S=list(map(int,input().split()))
S.sort()
L=[0]*(M-1)
for i in range(M-1):
    L[i]=abs(S[i]-S[i+1])

L.sort()
goukei=0
if M-N>=1:
    for i in range(M-N):
        goukei+=L[i]
else:
    print(0)
    exit()
print(goukei)
# Judge status: Accepted
S = input()

flag = False
for sta in range(len(S)):
    for end in range(sta, len(S)):
        if S[:sta] + S[end:] == "keyence":
            flag = True

if flag:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    a, b = map(int,input().split())
    space = 16 - (a + b)
    gap = abs(a-b)
    if gap <= -(-space // 2):
        print("Yay!")
    else:
        print(":(")

main()
# Judge status: Accepted
k = int(input())
if k%2==0:
    print((k//2)**2)
else:
    print((k//2)*(k//2+1))
# Judge status: Accepted
n=int(input())

if n==1: print(0); exit();
if n==2: print(1); exit();

if n%2==1:
  print(((n-1)+1)*((n-1)//2))
else:
  print(((n-1)+1)*((n-1)//2)+n//2)
# Judge status: Accepted
L = int(input())
print(L*L*L/27)
# Judge status: Accepted
n = int(input())

if n%2==0:
    odd = n//2
elif n%2==1:
    odd = n//2 + 1

ans = odd / n
print(ans)
# Judge status: Wrong Answer
ABC = list(map(int, input().split()))

ABC.sort(reverse = True)

step1 = ABC[0] - ABC[1]
step2 = ABC[0] - ABC[2] - step1

if step2 % 2 == 0:
    result  = int(step2 / 2) + step1
else:
    result = int(step2 / 2) + step1 + 1
print(result)
# Judge status: Wrong Answer
# coding: utf-8
N, A, B = map(int, input().split())
 
if A == 0:
    print(0)
elif B == 0:
    print(N)
elif N <= A:
    print(N)
else:
    num = int(N / (A + B)) * A
    #print("num:", num)
    num += N % (A + B)
    # print("num:", num)
    print(num)
# Judge status: Wrong Answer
n = int(input())
d = list(map(int,input().split()))

d.sort()
mind = d[n//2-1]
maxd = d[n//2]

print(mind,maxd)

ans = maxd - (mind + 1) + 1
if ans < 0:
    print(0)
    exit()
print(ans)
# Judge status: Wrong Answer
import collections

n, m = map(int, input().split())
h = list(map(int, input().split()))
sum_tenboudai = [1] * n

for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] < h[b-1]:
        sum_tenboudai[a-1] -= 1
    elif h[a-1] == h[b-1]:
        sum_tenboudai[a-1] -= 1
        sum_tenboudai[b-1] -= 1

sum_counter = collections.Counter(sum_tenboudai)
print(sum_counter[1])
# Judge status: Accepted
a,b=map(int,input().split())
num=[2,3,4,5,6,7,8,9,10,11,12,13,1]
print('Alice'if num.index(a)>num.index(b) else 'Bob'if num.index(a)<num.index(b) else'Draw')
# Judge status: Wrong Answer
from functools import reduce
from fractions import gcd
n=int(input())
s=list(map(int,input().split()))

if n==2:
  print(max(s))
  exit()
ma=1
for i in range(len(s)-1):
  t=s[i]
  s[i]=s[i+1]
  c=reduce(gcd,s)
  ma=max(ma,c)
  s[i]=t
else:
  t=s[i]
  s[i]=s[i-1]
  c=reduce(gcd,s)
  ma=max(ma,c)
  s[i]=t
print(ma)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A+B<=14:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
# A - Cookie Exchanges
a,b,c = map(int,input().split())

if a==b==c and c%2==0:
    print(-1)
else:
    ans = 0
    while a%2==b%2==c%2==0:
        ans += 1
        a,b,c = (b+c)//2,(c+a)//2,(a+b)//2
    print(ans)
# Judge status: Accepted
s=list(input())
K=int(input())
for i in range(len(s)-1):
    if s[i]!="a":
        a= ord("z")+1 - ord(s[i])
        if K>=a:
            s[i]="a"
            K-=a
if K:
    s[-1]=chr((K+ord(s[-1])-ord("a"))%(ord("z") - ord("a")+1)+ord("a"))
print("".join(s))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if b-a == c-b:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
from itertools import accumulate
N, K = map(int, input().split())
A = list(map(int, input().split()))

i = 0
for i in range(K):
    K -= 1
    B = [0] * (N + 1)
    for i, a in enumerate(A):
        j = max(0, i - a)
        B[j] += 1
        j = min(N, i + a + 1)
        B[j] -= 1
    B.pop()
    A = list(accumulate(B))
    tmp = A[0]
    if all(a == tmp for a in A):
        break

print(*A)