peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())
Xn = [int(x) for x in input().split()]
L = Xn[0]
R = Xn[0]
for i in range(N):
    L = min(L, Xn[i])
    R = max(R, Xn[i])

ans = float('inf')
for i in range(L,R):
    pos = 0
    for j in Xn:
        pos += (j-i)*(j-i)
    ans = min(ans, pos)
print(ans)
# Judge status: Accepted
n, x = map(int, input().split())
l = list(map(int, input().split()))

cum = [0] * (n+1)
for i in range(1, n+1):
    cum[i] = cum[i-1] + l[i-1]

f = True
for i in range(n+1):
    if cum[i] > x:
        f = False
        print(i)
        break
if f:
    print(n+1)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
x = [a , b]
y = [c , d]
m = a*c
for i in x:
  for j in y:
    if i*j > m:
      m = i*j
print(m)
# Judge status: Accepted
import sys
input = sys.stdin.readline

def main():
    n, q = map(int, input().split())
    s = input()
    t = [0]*(n + 1)

    for i in range(n):
        if s[i: i + 2] == "AC":
            t[i + 1] = t[i] + 1
        else:
            t[i + 1] = t[i]
    
    for i in range(q):
        l, r = map(int, input().split())
        print(t[r - 1] - t[l - 1])

main()
# Judge status: Accepted
X, Y =map(int, input().split())
mod = 1000000007

import sys
if (X + Y) % 3 != 0:
    print(0)
    sys.exit()
offset = (X+Y)//3
X, Y = X-offset, Y-offset

if X<0 or Y<0:
    print(0)
    sys.exit()
    
X, Y = max(X, Y), min(X, Y)

def C(n, r, mod):
    num = 1
    den = 1
    for i in range(r):
        num*=n-i
        num%=mod
        den*=i+1
        den%=mod
    return (num*pow(den, mod-2, mod))%mod

print(C(X+Y, Y, mod))
# Judge status: Accepted
X = int(input())
money = 100
count = 0
while money < X:
    money = int(money*1.01) 
    count +=1
print(count)
# Judge status: Wrong Answer
n = int(input())
*p, = map(int, input().split())
ans = 0
for i in range(n-1):
    if (p[i] == (i+1) or p[i+1] == (i+2)):
        if p[i] == (i+2) or p[i+1] == (i+1):
            continue
        ans += 1
        p[i], p[i+1] = p[i+1], p[i]
print(ans)
# Judge status: Accepted
A, B, M = map(int, input().split())
*a, = map(int, input().split())
*b, = map(int, input().split())
a_s = sorted(a)
b_s = sorted(b)
min_v = a_s[0] + b_s[0]
for _ in range(M):
    x, y, c = map(int, input().split())
    min_v = min(min_v, a[x-1] + b[y-1] - c, )
print(min_v)
# Judge status: Accepted
N = int(input())
S = input()

middle = len(S) // 2

if S[:middle] == S[middle:]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7
m = 62
d =[0]*m
ans = 0
for i in range(N):
    for j in range(m):
        if A[i]&(1<<j):
            ans += (1<<j)*(i-d[j])%mod
            d[j] += 1
        else:
            ans += (1<<j)*d[j]%mod
    ans %= mod
print(ans%mod)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n):
    k = i+1
    for j in range(i+1, n):
        while k < n and l[k] < l[i] + l[j]:
            k += 1
            ans += k - (j+1)
print(ans)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
dx = tx-sx
dy = ty-sy

print("R"*dx+"U"*dy+"R"+"D"*(dy+1)+"L"*(dx+1) +"U"\
    +"U"*dy+"R"*dx+"U"+"L"*(dx+1)+"D"*(dy+1) +"R" )
# Judge status: Wrong Answer
N, K = map(int, input().split())
A=[0]*N
for i in range(N):
    a=int(input())
    A[i]=a
A=sorted(A)

ans=[]
for i in range(N-K):
    ans.append(A[i+K-1]-A[i])

print(min(ans))
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = list(map(int, input().split()))

import math
import fractions
import functools
from operator import mul
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
  
LCM = lcm_list(a)

print((m // LCM ) +1 - (n // LCM))
# Judge status: Accepted
from sys import stdin


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    X, Y = list(map(int, _in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    ans = 'No'
    for x in range(0,101):
        for y in range(0,101):
            if x+y==X and 2*x+4*y==Y:
                ans = 'Yes'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M, K = map(int, input().split())
is_k = False
for k in range(N+1):
    for l in range(M+1):
        c = k*(M-l)+l*(N-k)
        if c==K:
            is_k = True

if is_k:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m = map(int,input().split())
ab_list = [list(map(int,input().split())) 
           for nesya in range(m)]
start = set()
end = set()
for ab in ab_list:
  if ab[0] == 1:
    start.add(ab[1])
  if ab[1] == n:
    end.add(ab[0])
ans = start&end
if len(ans) > 0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
# Judge status: Accepted
S = input()

li = []
cnt = 0
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        cnt += 1
    else:
        li.append(cnt)
        cnt = 0
li.append(cnt)

print(max(li))
# Judge status: Accepted
n, yen = map(int, input().split())
for x in range(n + 1):
    for y in range(n - x + 1):
        z = n - x - y
        if yen == x * 10000 + y * 5000 + z * 1000:
            print(x, y, z)
            exit(0)
print("-1 -1 -1")
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline
    ans = 0
    a = 10**3
    for i in range(5):
        x = int(input())
        ans += ((x + 9) // 10) * 10
        aa = x % 10
        if aa == 0:
            continue
        a = min(a, aa)
    if a == 10 ** 3:
        a = 10
    ans -= 10 - a
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys

N = int(input())
W = list(input() for _ in range(N))

if len(set(W)) == N:
	for i in range(N-1):
		a = W[i]
		b = W[i+1] 
		if a[0] != b[-1]:
			print('No')
			sys.exit()
		else:
			print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
a,b,c,d = map(int, input().split())
import fractions
r = b-a+1
g = c * d // fractions.gcd(c, d)
ans_c = b//c - (a-1)//c
ans_d = b//d - (a-1)//d
ans_r = b//r - (a-1)//r
print(r - ans_c - ans_d + ans_r)
# Judge status: Accepted
n, k = map(int, input().split())
d = list(map(int, input().split()))
ng = [False] * 10
for i in d:
    ng[i] = True
def ok(n):
    global ng
    while n > 0:
        if ng[n%10]:
            return False
        n //= 10
    return True
while not ok(n):
    n += 1
print(n)
# Judge status: Accepted
S = list(map(int,list(input())))
N = len(S)

sirokuro =[i%2 for i in range(0,N,1)]
kurosiro =[(i+1)%2 for i in range(0,N,1)]

loss1 = 0
for i in range(0,N,1):
    if S[i]!=sirokuro[i]:
        loss1 +=1

loss2 = 0
for i in range(0,N,1):
    if S[i]!=kurosiro[i]:
        loss2+=1

print(min(loss1,loss2))
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,input().split()))
count = 0

for i in range(n-1):
  if p[i] == i+1:
    count += 1
    p[i],p[i+1] = p[i+1],p[i]

print(count)
# Judge status: Wrong Answer
n=int(input())
if n<10:
    print(0)
elif n%2==0:
    a=int(n/2)
    b=0
    for i in range(n):
        a=a//5
        b+=a
        if a<4.5:
            break
    print(b)
else:
    print(0)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split(" ")))

c_dic = {}
for i in a:
    if i not in c_dic:
        c_dic[i] = 1
    else:
        c_dic[i] += 1
    
    if i + 1 not in c_dic:
        c_dic[i + 1] = 1
    else:
        c_dic[i + 1] += 1

    if i - 1 not in c_dic:
        c_dic[i - 1] = 1
    else:
        c_dic[i - 1] += 1

print(max(c_dic.values()))
# Judge status: Accepted
import math
n = float(input())
m_low = math.ceil(n / 1.08)
m_high = math.floor((n+1)/1.08)
if m_low > m_high:
  print(':(')
else:
  ch_low = math.floor(m_low*1.08)
  ch_high = math.floor(m_high*1.08)
  if ch_low == int(n):
    print(m_low)
  elif ch_high == int(n):
    print(m_high)
  else:
    print(':(')
# Judge status: Accepted
import re
S = input()
s = re.split('[BDEFHIJKLMNOPQRSUVWXYZ]',S)
print(max(map(len,s)))
# Judge status: Accepted
N, M = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N)]
cd = [tuple(map(int, input().split())) for _ in range(M)]

for a, b in ab:
  n = 10 ** 9
  m = 0
  for i, (c, d) in enumerate(cd):
    x = abs(a - c) + abs(b - d)
    if x < n:
      n = x
      m = i + 1
      
  print(m)
# Judge status: Accepted
n, m = list(map(int, input().split(' ')))
pairs = []

for i in range(m):
    pairs.append(list(map(int, input().split(' '))))

num = [-1 for i in range(n)]

for pair in pairs:
    s, c = pair

    if (num[s-1] != -1 and num[s-1] != c) or (s == 1 and c == 0 and n > 1):
        print(-1)
        exit(0)
    else:
        num[s-1] = c

for i in range(n):
    if num[i] == -1:
        num[i] = 0 if i != 0 or n == 1 else 1

print(''.join([str(i) for i in num]))
# Judge status: Accepted
X = int(input())

fh_joy = 0
five_joy = 0

amari = X
while amari >= 500:
    amari -= 500
    fh_joy += 1000
while amari >= 5:
    amari -= 5
    five_joy += 5
    
print(fh_joy + five_joy)
# Judge status: Accepted
S = input()

d = {"SUN": 7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1}
print(d[S])
# Judge status: Wrong Answer
n,m=map(int,input().split())
L=[]
R=[]
for i in range(m):
  l,r=map(int,input().split())
  L.append(l)
  R.append(r)
  
ans=min(R)-max(L)+1
print(ans)
# Judge status: Accepted
s = list(map(int,list(input())))
op_num = len(s)-1
for i in range(2**op_num):
  ans = ['-']*op_num
  total = s[0]
  for j in range(op_num):
    if (i>>j) & 1:
      total += s[j+1]
      ans[j]='+'
    else:
      total -= s[j+1]
  if total == 7:
    print(str(s[0])+ans[0]+str(s[1])+ans[1]+str(s[2])+ans[2]+str(s[3])+'=7')
    exit()
# Judge status: Wrong Answer

def main():
    N = int(input())
    S = input()
    f = S[:int(N/2)]
    b = S[int(-(-N//2)):]
    if f==b and len(f)>0:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
#110_a

A, B, C = [int(i) for i in input().split()]

desc = sorted([A,B,C], reverse=True)
print(desc[0]*10 + desc[1]+desc[2])
# Judge status: Accepted
A,B,C = map(int, input().split())
n = 0
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
  if A == B == C:
    print ('-1')
    exit()
  else:
    a = B/2 + C/2
    b = A/2 + C/2
    c = A/2 + B/2
    A = a
    B = b
    C = c
    n += 1
  
  
print(n)
# Judge status: Wrong Answer
n = int(input())


x = n - 2
y = n - x

if n <= 10:
    print(n)
else:
    resulty, resultx = 0, 0

    while(x > 0):
        resultx += x % 10
        x = x // 10

    while(y > 0):
        resulty += y % 10
        y = y // 10

    #print(resulty+resultx)
    z = n//2

    result = 0
    while(z > 0):
        result += z % 10
        z = z // 10

    if result*2 < resulty+resultx:
        print(result*2)
    else:
        print(resulty+resultx)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,k=map(int, input().split())
    l=list(map(int,input().split()))
    cnt=0
    while True:
        if n<=k:
            cnt+=1
            print(cnt)
            break
        n -= k
        n += 1
        cnt += 1
resolve()
# Judge status: Accepted
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
arr1, arr2 = [0], [0]
for i in range(n):
	arr1.append(arr1[i] + A[i])
for i in range(m):
	arr2.append(arr2[i] + B[i])

count = 0
j = m
for i in range(n + 1):
	if arr1[i] > k:
		break
	while arr2[j] > k - arr1[i]:
		j -= 1
	count = max(count, i + j)
print(count)
# Judge status: Accepted
S = input()
T = input()
t = len(T)

for i in range(len(S)-t, -1, -1):
    for j in range(t):
        k = S[i+j]
        if k != T[j] and k != "?":
            break
    else:
        print((S[:i]+T+S[i+t:]).replace("?", "a"))
        exit()
print("UNRESTORABLE")
# Judge status: Accepted
def is_prime(n):
    if n == 2:
        return True
    if (n < 2) or (n % 2 == 0):
        return False
    stop = int(n**0.5) + 1
    for i in range(3, stop, 2):
        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())
a=list(map(int,input().split()))

kab=0
mon=1000

for i in range(n-1):
    if a[i]<a[i+1]:
        x=mon//a[i]
        kab+=x
        mon-=x*a[i]
    else:
        mon+=kab*a[i]
        kab=0

mon+=a[-1]*kab

print(mon)
# Judge status: Wrong Answer
Q,H,S,D = map(int,input().split())
ans = 0
N = int(input())
costs = sorted([(Q*8,0.25),(H*4,0.5),(S*2,1.0),(D,2.0)])
for cost,v in costs:
    if N < v:
        continue
    if v == 0.25:
        cost /= 8
    elif v == 0.5:
        cost /= 4
    elif v == 1.0:
        cost /= 2
    a = N // v
    N -= v * a
    ans += cost * a
    if N == 0:
        break
print(int(ans))
# Judge status: Accepted
A,B,X = map(int,input().split())

if X-A <= B and A <= X:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
d,t,s=map(int, input().split())
if t*s>=d:
    print('Yes')
else: print('No')
# Judge status: Accepted
n, m = map(int, input().split())
cnt = [0]*m
ans = 0

for i in range(n):
    k, *a = map(int, input().split())
    for j in a:
        cnt[j - 1] += 1

for i in cnt:
    if i == n:
        ans += 1

print(ans)
# Judge status: Wrong Answer
N,R = map(int,input().split())
if N >= 10:
  print(R)
else:
  print(100*(10-N))
# Judge status: Accepted
n=int(input())
s=set()
for i in range(n):s^={input()}
print(len(s))
# Judge status: Accepted
def main():
    N = int(input())
    lucas = [0] * (N+1)
    lucas[0] = 2
    lucas[1] = 1
    for i in range(2, N+1, 1):
        lucas[i] = lucas[i-1] + lucas[i-2]
    print(lucas[N])

main()
# Judge status: Wrong Answer
S=list(input())

s=0
f=0
g=0
h=0
for i in range(len(S)):
    if S[i]==">":
        g=0
        f+=1
        if f!=1:
            if h>=f:
                s+=f-1
            else:
                s+=f
        
    else:
        f=0
        g+=1
        s+=g
        h=g

print(s)
# Judge status: Accepted
import sys
def input():
    return sys.stdin.readline()[:-1]
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

def main():
    N = int(input())
    if N%2 == 1:
        print(0)
    else:
        t = 2*5
        s = 0
        while t <= N:
             s += N//t
             t *= 5
        print(s)
if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
v=list(map(int,input().split()))

v.sort()
for i in range(0,n-1):
  t=v.pop(0)
  v[0]=(v[0]+t)/2
print(v[0])
# Judge status: Accepted
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if max(x) < min(y) and X < min(y) <= Y:
	print("No War")
else:
	print("War")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
k=int(input())
for i in range(k):
  if b<=a:
    if c<=b:
      c*=2
    else:
      b*=2
  elif c<=b:
    c*=2
  else:
    a*=2

if a<b and b<c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a = int(input())
    b = int(input())
    h = int(input())

    res = ((a + b) * h) // 2
    print(res)


if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
N, M = map(int,input().split())
height = list(map(int,input().split()))
bet,cost = [],[0]*N
for i in range(M):
     bet.append(list(map(int,input().split())))

for b in bet:
    if height[b[0]-1] < height[b[1]-1]:
        cost[b[1]-1] = 1
    else:
        cost[b[0]-1] = 1

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

boxes = [0]*N
for i in range(N)[::-1]:
  s = sum(boxes[i::i+1])
  if s % 2 != A[i]:
    boxes[i] = 1

M = sum(boxes)
print(M)
if M != 0:
  print(*[i + 1 for i, j in enumerate(boxes) if j == 1])
# Judge status: Wrong Answer
z=(input().split())
a=int(z[0])
b=int(z[1])
c=input()
if len(c)>=1 and len(c)<=50 and b>=1 and b<=len(c):
	c=c.replace(c[b-1],c[b-1].lower())
	print(c)
# Judge status: Accepted
n, m = map(int, input().split())
cnt = [0] * m
for i in range(n):
    a = list(map(int, input().split()))
    for x in a:
        cnt[x - 1] += 1
    cnt[a[0]-1] -= 1

ans = 0
for i in range(m):
    ans += cnt[i] == n
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
P = []
S = []
for i in range(M):
    tmp = input().split()
    P.append(int(tmp[0]))
    S.append(tmp[1])

point = 0
pena = 0
ind = 0

for p in set(P):
    isAC = False
    for i in range(P.count(p)):
        if S[ind] == "AC" and isAC == False:
            isAC = True
            point += 1
        if S[ind] == "WA" and isAC == False:
            pena += 1
        ind += 1

print(point, pena)
# Judge status: Wrong Answer
import math
MOD = 10**9+7
n, m = map(int, input().split())

if n == m:
    print( (2 * (math.factorial(n)%MOD)**2) % MOD)
elif abs(n-m) == 1:
    print((math.factorial(min(n, m))%MOD) * max(n, m))
else:
    print(0)
# Judge status: Wrong Answer
n = int(input())
max_check = int((n**(1/2))//1)
now = 1
num = 1
for i in range(1, n):
    now = int(i*(i+1)/2)
    if now >= n:
        num = i
        break
diff = now - n
for i in range(1,num+1):
    if i == diff:
        pass
    else:
        print(i)
# Judge status: Wrong Answer
A,B,K=map(int,input().split())
N=100
ls=[]
LS=[]
for i in range(1,N):
  if A%i==0:
    ls.append(i)
  if B%i==0:
    LS.append(i)
r=set(ls)
R=set(LS)
r=set(r & R)
r=list(r)
r.sort(reverse=True)
print(r[K-1])
# Judge status: Accepted
S = input()
stack = []
cnt = 0
for s in S:
    if not stack:
        stack.append(s)
    elif stack[-1] != s:
        stack.pop()
        cnt += 2
    else:
        stack.append(s)
print(cnt)
# Judge status: Accepted
def tag(a,b,v,w,t):
    res = (v*t)-(abs(b-a)+(w*t))
    if res>=0:
        return "YES"
    return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
res = [-1]*N

for i in reversed(range(1, N + 1)):
    p = (N // i) * i
    s = 0
    while res[p - 1] != -1:
        s += res[p - 1]
        s %= 2
        p -= i
    res[p - 1] = (A[p - 1] - s) % 2

print(sum(res))
for i in range(N):
    if res[i] == 1:
        print(i + 1)
# Judge status: Accepted
str=input()
a=int(list(str)[0])
b=int(list(str)[1])
c=int(list(str)[2])
print(a+b+c)
# Judge status: Wrong Answer
A = list(input().split())
a = int(''.join(A))
if a%4==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# S
S = input()

if S == 'ABC':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
n_l=list(input())
now=0
N=int(input())
if n_l[:N].count("1") == len(n_l[:N]):
   print(1)
else:
   for i in range(len(n_l)):
      if n_l[i] != "1":
         print(n_l[i])
         exit()
# Judge status: Accepted
N = int(input())
A = input().split()
count = 0

for i in range(N):
  A[i] = int(A[i])
for i in range(N-1):
  if A[i] > A[i+1]:
    count += A[i] - A[i+1]
    A[i+1] = A[i]

print(count)
# Judge status: Accepted
N=[int(x) for x in list(input())]
if sum(N)%9==0:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
N, x = map(int, input().split())
*a, = map(int, input().split())
a = a+[0]
ans = 0
for i in range(0, N):
    d = a[i]+a[i+1]-x
    if d > 0:
        for j in range(i+1, i-1, -1):
            s = min([a[j], d])
            d -= s
            a[j] -= s
            ans += s
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())

if (a+b==c or a+c==b or b+c==a) :
    print("Yes")

else:
    print("No")
# Judge status: Accepted
N = int(input())
lisA = [1] + list(map(int,input().split()))

ans = 0
flg = False
for i,v in enumerate(lisA):
    if flg:
        flg = False
        continue
    elif i == v:
        ans += 1
        flg = True

print(ans)
# Judge status: Accepted
N = int(input())
A = [0]*N
B = [0]*N
for i in range(N):
    A[i],B[i] = map(int,input().split())
A.sort()
B.sort()

if N % 2 == 1:
    mid_ind = N//2
    lower = A[mid_ind]
    upper = B[mid_ind]
    print(upper-lower+1)

else:
    mid_a = N//2
    mid_b = mid_a-1
    lower = (A[mid_a]+A[mid_b])/2
    upper = (B[mid_a]+B[mid_b])/2
    print(int((upper-lower)*2+1))
# Judge status: Wrong Answer
a, b, c = list(map(str, input().split()))
if a != b != c:
    print(3)
elif a == b == c:
    print(1)
else:
    print(2)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = 0
for i, a in enumerate(A):
  if L + a <= S/2:
    L += a
  else:
    R = S - L
    diff = R - L
    if 2*a - diff < diff:
      L += a
      R -= a
    break
    
R = S - L
print(abs(R - L))
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
for i in range(1, n):
    candy = a[i - 1] + a[i]
    if candy > x:
        ans += candy - x
        a[i] = max(0, a[i] - candy + x)

print(ans)
# Judge status: Accepted
N = int(input())
T = []
for i in range(5):
    T.append(int(input()))
k = 0
for i in range(5):
    if N % T[i] == 0:
        k = max(k, N//T[i])
    else:
        k = max(k, N//T[i] + 1)
print(4 + k)
# Judge status: Accepted
N, M = map(int, input().split())

if N == M:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)
# Judge status: Wrong Answer
# A - Next Alphabet
def main():
    C = input().rstrip()
    ans = chr(ord(C) + 1)
    print(C)


if __name__ == "__main__":
    main()
# Judge status: Accepted
s=str(input())
if s=="keyence":
  print("YES")
  exit()
f=False
for i in range(len(s)-1):
  for j in range(i+1,len(s)):
    if s[:i]+s[j:]=="keyence":
      f=True
      break
print("YES" if f==True else "NO")
# Judge status: Accepted
def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    if n==k:
        print(1)
    else:
        print((n+k-3)//(k-1))

if __name__ == '__main__':
    main()
# Judge status: Accepted
import itertools
n, m, q = map(int, input().split())
Q = [list(map(int, input().split())) for i in range(q)]
m = [i for i in range(1, m+1)]
p = itertools.combinations_with_replacement(m, n)

ans = []
for v in p:
    count = 0
    for i in Q:
        if v[i[1]-1]-v[i[0]-1] == i[2]:
            count += i[3]
    ans.append(count)
print(max(ans))
# Judge status: Wrong Answer
#ABC058.A
a,b,c = map(int,input().split())
if abs(a-b)==abs(b-c) or abs(a-c)==abs(a-b) or abs(a-c)==abs(b-c):
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
N = int(input())
A =[2,1]
if N <= 2:
    print(A[N-1])
    exit()
for i in range(2,N+1):
    A.append(A[i-1]+A[i-2])
print(A[-1])
# Judge status: Accepted
(A,) = [int(x) for x in input().split()]
print(A + A * A + A * A * A)
# Judge status: Accepted
n = int(input())
L = list(map(int,input().split()))
L.sort()
import bisect
ans = 0
for i in range(1,n):
    for j in range(i+1,n):
        tmp = L[:i]
        v = L[j]-L[i]
        idv = bisect.bisect_right(tmp,v)
        if idv!=len(tmp):
            ans += len(tmp)-idv
print(ans)
# Judge status: Wrong Answer
s = int(input())
co = []
ans = 1
count = 1
while count == 1:
    if s % 2 == 0:
        s /= 2
        co.append(s)
        ans += 1
       
    else:
        s = 3*s + 1
        co.append(s)
        ans += 1
        
    count = co.count(s)
    if count == 2:
      print(ans)
# Judge status: Wrong Answer
triangulo = input()
lados = triangulo.split()
AB = lados[0]
BC = lados[1]
area = (int(AB) * int(BC))/2
print(area)
# Judge status: Accepted
n,x,y = map(int,input().split())
ans = {}
s = (y-x+1)//2
s = x+s
for i in range(1,n):
    for j in range(i+1,n+1):
        if i <= s:
            dist = min(j-i,abs(i-x)+abs(j-y)+1)
        else:
            dist = j-i
        if dist in ans.keys():
            ans[dist] += 1
        else:
            ans[dist] = 1
for k in range(1,n):
    if k in ans.keys():
        print(ans[k])
    else:
        print(0)
# Judge status: Accepted
s = input()
N = len(s)
if(s[N-1] == "s"):
  print(s + "es")
else:
  print(s+ "s")