peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())
h = list(map(int, input().split()))
l = list(map(int, input().split()))
c = h[0]

for i in range(N):
    if sum(h[i+1:])< sum(l[i:]):
        c += sum(l[i:])
        print(c)
        exit()
    else:
        c += h[i+1]
# Judge status: Wrong Answer
H=int(input())
W=int(input())
N=int(input())
K=H
if K<W: K=W
sum = 0
ans= 0
for i in range(1,K):
  if sum < N:
    sum += K
    ans = i
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
count = 0
while (x <= y):
	x *= 2
	count += 1
print(count)
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
A.sort(reverse = True)
HW = []
i = 1
while i<N:
  if A[i]==A[i-1]:
    n = A.count(A[i])
    HW += [A[i]]*(min(n//2,2))
    i = i + n -1
  else:
    i = i + 1
  if len(HW)>=2:
    break
if len(HW)<2:
  print(0)
else:
  print(HW[0]*HW[1])
# Judge status: Accepted
a,b = map(int,input().split())
if a <= 9 and b <= 9:
  print(a*b)
else:
  print(-1)
# Judge status: Accepted
a = input()

if a.isupper():
  print('A')
else:
  print('a')
# Judge status: Accepted
a = int(input())
x = 0
if a == 0:
    x = 1
print(x)
# Judge status: Accepted
a,b=map(int,input().split())
if a>=b:
  s=[str(b)]*a
  print("".join(s))
else:
  s=[str(a)]*b
  print("".join(s))
# Judge status: Accepted
import math

N, R = map(int, input().split())
X = math.log(N + 0.000001, R)
Y = math.ceil(X)

print(Y)
# Judge status: Accepted
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b = I()
for i in range(2):
    if a >= b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1
print(ans)
# Judge status: Accepted
n,k = map(int, input().split())
for i in range(32):
    if k**i <= n < k**(i+1):
        print(i+1)
        break
# Judge status: Accepted
n = int(input())

c = n % 1000

if c == 0:
    s = 0
else:
    s = 1000 - c

print(s)
# Judge status: Wrong Answer
n = int(input())
a = list(input())
xlist = []
x = 0
for i in range(n):
  if a[i]=="D":
    x+=1
  elif a[i]=="I":
    x-=1
  xlist.append(x)
print(max(xlist))
# Judge status: Accepted
import heapq
n, m = [int(i) for i in input().split()]
a = [-int(i) for i in input().split()]
heapq.heapify(a)


def d(x):
    return -((-x)//2)


for _ in range(m):
    b = heapq.heappop(a)
    heapq.heappush(a, d(b))

print(-sum(a))
# Judge status: Wrong Answer
n = int(input())
s = input()
 
if n%2 == 1:
  print("No")
 
slise = n/2
a = s[:int(slise)]
b = s[int(slise):]
 
if a==b:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
if A==B and B==C and A==C:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import math
import sys
input = sys.stdin.readline

N = int(input())
ans = 0
k = int(math.log10(N)) + 1
A = N//(10**(k-1))
if (A + 1) * (10 ** (k - 1)) - 1 <= N:
    ans = A + 9*(k-1)
else:
    ans = A-1+9*(k-1)
print(ans)
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
ans = []
for _ in range(tx-sx):
    ans.append("R")
for _ in range(ty-sy):
    ans.append("U")
for _ in range(tx-sx):
    ans.append("L")
for _ in range(ty-sy):
    ans.append("D")
ans.append("D")
for _ in range(tx-sx+1):
    ans.append("R")
for _ in range(ty-sy+1):
    ans.append("U")
ans.append("L")
ans.append("U")
for _ in range(tx-sx+1):
    ans.append("L")
for _ in range(ty-sy+1):
    ans.append("D")
ans.append("R")
print("".join(ans))
# Judge status: Accepted
s = input()
n = len(s)

l = set(s)
m = len(l)

if n == m:
  print("yes")
else:
  print("no")
# Judge status: Wrong Answer
N = int(input())
a = map(int, input().split())

a = sorted(a, reverse=True)

Alice = 0
Bob = 0

for i in range(0,N-2,2):
    Alice += a[i]
    Bob += a[i+1]


print(Alice-Bob)
# Judge status: Accepted
import sys

n = int(input())
numeros = [int(x) for x in input().split()]
saida = sys.maxsize

for i in range(min(numeros), max(numeros)+1):
	valor = 0
	for j in numeros:
		valor += (j-i)**2
	
	saida = min(valor, saida)

print(saida)
# Judge status: Wrong Answer
K, A, B = map(int, input().split())
if A >= B:
  ans = K+1
else:
  if K-A-1 < 0:
    n = 0
    ans = K+1
  else:
    n = (K-A-1)//2
    m = (K-A-1)%2
    ans = n*(B-A) + m + B
print(ans)
# Judge status: Wrong Answer
N, K = map(int,input().split())
print(N-(N//K)*K)
# Judge status: Wrong Answer
nb = int(input())
somme = 0
mmax = 0
for loop in range(nb):
  n,m = map(int,input().split())
  if n<=m:
    somme+=n
  if m>mmax:
    mmax = m
if somme<=mmax:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
#n=int(input())
n,K=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

pt=set(al)
dic={}
for ai in al:
    dic[ai]=dic.get(ai,0)+1
l2d=[]
for k, v in dic.items():
    l2d.append([k,v])
l2d.sort(key=lambda x: x[1])

ans=0
for i in range(len(pt)-K):
    ans+=l2d[i][1]
print(ans)
# Judge status: Wrong Answer
x = int(input())
 
while True:
    
    for i in range(2, int(x**0.5)+1):
        print(i)
        if x % i == 0:
            break 
    else:
        print(x)
        break 
    x += 1
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():    
    MOD = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    ans = 0
    for i in range(60):
        x = 0
        for j in range(n):
            if a[j] >> i & 1:
                x += 1
        ans += x * (n - x) * 2 ** i
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
K,N = map(int,input().split())
L = [i for i in map(int,input().split())]
L.append(L[0])
dist = []
for i in range(N):
  if L[i+1] == 0 or L[i+1] == K:
    dist.append(min(abs(0-L[i]),abs(K-L[i])))
  else:
    dist.append(abs(L[i+1]-L[i]))
print(sum(dist)-max(dist))
# Judge status: Accepted
S = list(input())
ans = True
for i in range(len(S)):
  if i % 2 != 0:
    if S[i] != "L" and S[i] != "U" and  S[i] != "D":
      ans = False
  else:
    if S[i] != "R" and S[i] != "U" and S[i] != "D":
      ans = False
if ans:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
#ABC118

n,m = list(map(int,input().split()))
food = [0] * m
for i in range(n):
    a = list(map(int,input().split()))
    for j in a[1:]:
        food[j-1] += 1
        
l = [food[i] for i in range(len(food)) if food[i] == n]
print(len(set(l)))
# Judge status: Accepted
# do simulation

X = int(input())
Y, K = 0, 0
while True:
  Y += X
  K += 1
  if Y % 360 == 0:
    print(K)
    exit()
# Judge status: Accepted
''''atcoder beginner contest-170'''

import math
from collections import defaultdict
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

'''C'''
x,n=rm()
l=True
try:
    a=rl()
except:
    a=[]
b=defaultdict(int)
for i in a:
    b[i]=1
mini=math.inf
value=-1
for j in range(-101,201):
    if b[j]!=1:
        if abs(x-j)<mini:
            mini=abs(x-j)
            value=j
print(value)
# Judge status: Accepted
N,A,B = map(int,input().split())

if A > B :
  print(0)
elif N == 1 and A == B:
  print(1)
elif N == 1 and A!= B:
  print(0)
else:
  a = (N-2)*(B-A) + 1
  print(a)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = input()
if "##" in s[a:max(c,d)]:
	print ("No")
	exit()

if c > d:
	if "..." not in s[b:d]:
		print ("No")
		exit()
print ("Yes")
# Judge status: Accepted
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    c = collections.Counter()

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                c[x * x + y * y + z * z + x * y + y * z + z * x] += 1

    for i in range(1, N + 1):
        print(c[i])


if __name__ == '__main__':
    main()
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
a = intl()

ans = 0
for i in range(1,n):
	if a[i-1] > a[i]:
		ans += (a[i-1] - a[i])
		a[i] += (a[i-1] - a[i])
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
s=[list(map(int,input().split())) for _ in range(n)]
c=[list(map(int,input().split())) for _ in range(m)]
where=[]
for i in range(n):
    distance=10**9
    for j in range(m):
        if distance>abs(s[i][0]-c[j][0])+abs(s[i][1]-c[j][1]):
            distance=abs(s[i][0]-c[j][0])+abs(s[i][1]-c[j][1])
            w=j
    where.append(w+1)
[print(i) for i in where]
# Judge status: Accepted
n = input()
ans = 0
accu = 0
for i, j in enumerate(n):
    j = int(j)
    if j>0:
        ans = max(ans, accu+j-1+9*(len(n)-i-1))
    accu += j
ans = max(ans, accu)
print(ans)
# Judge status: Accepted
def resolve():
    N = int(input())
    A = [int(input()) - 1 for _ in range(N)]
    flgs = [False for _ in range(N)]
    flgs[0] = True
    i = A[0]
    flgs[i] = True
    cnt = 1
    while not flgs[1]:
        i = A[i]
        if flgs[i]:
            print(-1)
            return
        else:
            flgs[i] = True
            cnt += 1
    else:
        print(cnt)


resolve()
# Judge status: Wrong Answer
H,N = map(int,input().split())
A = list(map(int,input().split()))
Sum = sum(A)

if H - Sum < 0:
    print("Yes")
elif H - Sum > 0:
    print("No")
# Judge status: Accepted
n=int(input())
a=[int(input()) for _ in range(n)]

paper=set()
for i in range(n):
    if a[i] not in paper:
        paper.add(a[i])
        continue
    if a[i] in paper:
        paper.discard(a[i])
        continue

print(len(paper))
# Judge status: Wrong Answer
a , b , c = map(int,input().split())
if b - a == c - b:
  print("Yes")
else: 
  print("No")
# Judge status: Accepted
K = int(input())

print(len(range(2, K+1, 2)) * len(range(1, K+1, 2)))
# Judge status: Wrong Answer
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
from collections import Counter
C = Counter(input())
if ((C["N"] == 0 and C["S"] == 0) or (C["N"] != 0 and C["S"] != 0)) and ((C["W"] == 0 and C["E"] == 0) or (C["W"] != 0 and C["E"] != 0)):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from collections import defaultdict
n = int(input())
dic = defaultdict(int)
for i in range(n):
  dic[input()] += 1
max_s = max(dic.values())
for k, v in sorted(dic.items()):
  if v == max_s:
    print(k)
# Judge status: Wrong Answer
n,m = [int(x) for x in input().split()]
li = list()
for i in range(m):
    li.append([int(x) for x in input().split()])

for i in range(1000):
    length = len(str(i))
    for j in li:
        if (length<j[0] or length != n):
            break
        if (str(i)[j[0]-1] != str(j[1])):
            break
    else :
        print(i)
        break
else:
    print("-1")
# Judge status: Wrong Answer
S = input()
year_list = ["01","02","03","04","04","05","06","07","08","09","10","11","12"]

if S[0:2] in year_list:
    if S[2:4] in year_list:
        print("AMBIGUOUS")
    elif S[2:4] == "00":
        print("NA")
    elif int(S[2:4]) >= 32:
        print("NA")
    else:
        print("YYMM")
elif S[0:2] == "00":
    print("NA")
elif int(S[0:2]) >= 32:
    print("NA")
else:
    if S[2:4] in year_list:
        print("MMYY")
    else:
        print("NA")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

b = [0] * (N+1)
b[0] = 1
flag = True

for i in range(N):
    if A[i] > b[i]:
        flag = False

    b[i+1] = (b[i] - A[i]) * 2

if A[N] > b[N]:
    flag = False
ans = 0
l = 0
for i in range(N, -1, -1):
    l += A[i]
    ans += min(l, b[i])

if flag:
    print(ans)
else:
    print(-1)
# Judge status: Accepted
n = int(input())
n = n % 10
if n == 2 or n == 4 or n == 5 or n == 7 or n == 9:
    print("hon")
elif n == 0 or n == 1 or n == 6 or n == 8:
    print("pon")
else:
    print("bon")
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
for i in range(A, A + K):
    print(i)
for i in range(B - K + 1, B + 1):
    print(i)
# Judge status: Wrong Answer
import sys
n,m = map(int,input().split())
if m < 2:
  print(0)
  sys.exit()
if 2*n > m > n:
  print(min(n,n//2))
  sys.exit()
m -= 2*n
print(n+(m//4))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = {}
for x in a:
  try:
    if b[x]:
      b[x] += 1
  except:
    b[x] = 1
#print(b)
ans = sum(a)
q = int(input())
for _ in range(q):
  x,y = map(int,input().split())
  try:
    if b[x]:
      bx = b[x]
      b[x] = 0
  except:
    #print(b)
    print(ans)
    continue
  try:
    if b[y]:
      b[y] += bx
  except:
    b[y] = bx
  #print(b)
  ans -= bx * x
  ans += bx * y
  print(ans)
# Judge status: Wrong Answer
N, Q = map(int, input().split())
S = list(input())
for _ in range(Q):
    l, r = map(int, input().split())
    line = S[l-1:r]
    count = 0
    for i in range(r-l):
        if line[i] == 'A' and line[i+1] == 'C':
            count += 1
# Judge status: Accepted
a, b = map(int, input().split())
import fractions
import math
n = fractions.gcd(a,b)
a = []
while n % 2 == 0:
  a.append(2)
  n //= 2
f = 3
while f * f <= n:
  if n % f == 0:
    a.append(f)
    n //= f
  else:
    f += 2
if n != 1:
  a.append(n)
print(len(set(a))+1)
# Judge status: Wrong Answer
N = int(input())
s = input()
ind1 = 0
ind2 = N
for i in range(N):
    if s[i] == '(':
        ind1 = i
        break

for i in range(N):
    if s[N-i-1] == ')':
        ind2 = N-i
        break

left = s[:ind1].count(')')
right = s[ind2:].count('(')

mid_left = s[ind1:ind2].count(')')
mid_right = s[ind1:ind2].count('(')

left += max(0,mid_left-mid_right)
right += max(0,mid_right-mid_left)

ans = '('*left + s + ')' * right
print(ans)
# Judge status: Accepted
x, y, z = map(int, input().split())
if y - x == z - y:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, k = list(map(int, input().split()))
d = set(input().split())

for i in range(n, 100001):
    if set(list(str(i))) & d == set():
        print(i)
        break
# Judge status: Accepted

def solve():

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

    list = []

    for i in range(1, min(A, B) + 1):
        if A % i == 0 and B % i == 0:
            list.append(i)
    print(list[len(list)-K])


if __name__ == "__main__":
    solve()
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

import bisect
N, M, K = map(int, input().split())
A = list(map(int, (input().split())))
B = list(map(int, (input().split())))
cumA, cumB = [0], [0]
for a in A:
    cumA.append(cumA[-1]+a)
for b in B:
    cumB.append(cumB[-1]+b)
ans = 0
for i in range(N, -1, -1):
    if cumA[i] > K: continue
    j = bisect.bisect_right(cumB, K-cumA[i])
    ans = max(ans, i+j-1)
print(ans)
# Judge status: Accepted


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

def sol(x, k, d):

    x = abs(x)

    temp = x // d

    if temp >= k:
        return x - d * k

    x -= temp * d
    k -= temp

    if k % 2 == 0:
        return x
    
    return abs(x - d)

print (sol(x, k, d))
# Judge status: Accepted
def main():
    N = int(input())
    X = list(map(int, input().split()))

    P = sum(X) // N
    ans1 = 0
    for x in X:
        ans1 += (x - P) ** 2
    ans2 = 0
    for x in X:
        ans2 += (x - (P + 1)) ** 2
    print(min(ans1, ans2))


if __name__ == "__main__":
    main()
# Judge status: Accepted
S = input()
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline
c=[list(map(int,input().split())) for i in range(3)]
for i in range(2):
    for j in range(2):
        if c[i][j]-c[i][j+1] != c[i+1][j]-c[i+1][j+1]:
            print("No")
            exit()
        if c[i][j]-c[i+1][j] != c[i][j+1]-c[i+1][j+1]:
            print("No")
            exit()
print("Yes")
# Judge status: Accepted
n = int(input())
a_l = list(map(int, input().split()))
b_l = list(map(int, input().split()))

ans = 0
c = 0
for i in range(1, n+1):
    a = a_l[-i]
    if b_l[-i] + c >= a:
        ans += a
        d = c-a
        if d >=0:
            d=0
        c = b_l[-i] - abs(d)
    else:
        ans += b_l[-i] + c
        c = 0

if a_l[0] >= c:
    ans+= c
else:
    ans+= a_l[0]
print(ans)
# Judge status: Accepted
k=int(input())
a=[i+1 for i in range(9)]
while (1):
  if k<=len(a):
    print(a[k-1])
    f=1
    break
  
  k=k-len(a)
  #print(k)
  b=[]
  for x in a:
    for i in [-1,0,1]:
      d=x%10+i
      #print(d)
      if d<0 or d>=10: continue
      b.append(x*10+d)
  a=b.copy()
  #print(a)
# Judge status: Accepted
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split()))) - np.arange(1, n+1)
b = int(np.median(a))
print(int(np.sum(np.abs(a - b))))
# Judge status: Wrong Answer
#094_D
n = int(input())
a = sorted(list(map(int, input().split())))
m = a[-1]
mid = m // 2
idx = 10 ** 10
for i in range(n-1):
    if abs(a[i]-mid) < abs(a[i]-idx):
        idx = a[i]
print(m, idx)
# Judge status: Wrong Answer
N,M=map(int,input().split())
O = M//2
P = (N+O)//2
       
print(P)
# Judge status: Accepted
a = list(map(int, input().split()))
k = int(input())
for i in range(k):
  a[a.index(max(a))] *= 2
print(sum(a))
# Judge status: Wrong Answer
C=[list(input()) for i in range(2)]
N=C[1].reverse()
if C[0]==N:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n = int(input())
l = [int(input()) for _ in range(5)]
ans = 0 - -n//min(l) + 4
print(ans)
# Judge status: Accepted
S = input()
K = int(input())

cnt = K
ans = ''

for s in S:
    if s == 'a':
        ans += 'a'
    elif cnt >= 123 - ord(s):
        cnt -= 123 - ord(s)
        ans += 'a'
    else:
        ans += s

last = ans[-1]
last = chr((ord(last) - 97 + cnt) % 26 + 97)
print(ans[:-1] + last)
# Judge status: Accepted
s = []
for l in raw_input():
	if l == 'B':
		if s:s.pop()
	else:
		s.append(l)
print ''.join(s)
# Judge status: Accepted
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = input()

ans = 0
log = ["*"]*N
win = {"r":"p","s":"r","p":"s"}
score = {"r":P,"s":R,"p":S}
for i,t in enumerate(T):
    if log[i-K]==win[t]: continue
    log[i] = win[t]
    ans += score[t]
print(ans)
# Judge status: Accepted
n=int(input())
a=[0]+list(map(int,input().split()))
b=[0 for i in range(n+1)]

for i in range(n):
    b[a[i]]+=1

[print(i) for i in b[1:]]
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys,math,itertools
input = sys.stdin.readline
n, k = map(int, input().split())
d = [int(_) for _ in input().split()]
d_set = set(d)
d_all = set(range(10))
d_use = [str(a) for a in list(d_all - d_set)]
keta = int(math.log10(n))+1
l1 = [int(''.join(list(a))) if int(''.join(list(a)))>=n else 100000 for a in list(itertools.product(d_use, repeat=keta+1))]
l2 = [int(''.join(list(a))) if int(''.join(list(a)))>=n else 100000 for a in list(itertools.product(d_use, repeat=keta))]

print(min(min(l1), min(l2)))
# Judge status: Accepted
H, N = map(int, input().split())
A = list(map(int, input().split()))
print("Yes" if H<=sum(A) else "No")
# Judge status: Accepted
N = int(input())

ans = 0
for i in range(1, N):
    ans += (N-1) // i

print(ans)
# Judge status: Accepted
S = input()
T = input()
ans = 1001
for i in range(len(S) - len(T) + 1):
  a = 0
  for s in range(len(T)):
    if T[s] != S[i+s]:
      a += 1
  if a < ans:
    ans = a
print(ans)
# Judge status: Accepted
import math
A,B=[i for i in input().split()]
f2i = int(float(B)*100 + 0.5)
print( (int(A)*f2i) // 100 )
# Judge status: Wrong Answer
import sys
import numpy as np
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(n, a):
  for _ in range(1, n):
    new = (a[1]+a[0])/2
    a = np.delete(a, 0)
    a[0] = new
  return new
n = int(readline())
a = np.array(readline().split(), np.int64)
a = np.sort(a)
print(main(n,a))
# Judge status: Wrong Answer
S = input()
o = S.count("1")
s = S.count("0")
print(min(o, s)**2)
# Judge status: Wrong Answer
a = input()
b = int(a)

count = 0
for i in range(len(a)-1):
    ichi = b%10
    if ichi == 1:
        count+=1
    
    b %= 10

print(count)
# Judge status: Wrong Answer
N, A, B = map(int, input().split())

if (B-A) % 2 == 0:
    print((B-A) // 2)
else:
    print(min(B - 1, N - A))
# Judge status: Accepted
N, H, *blades = map(int, open(0).read().split())
cut = max(blades[::2])
throws = sorted(b for b in blades[1::2] if b >= cut)

ans = 0
while throws:
    H -= throws.pop()
    ans += 1
    if H <= 0:
        print(ans)
        exit()

ans += (H + cut - 1) // cut
print(ans)
# Judge status: Accepted
import numpy as np

n = int(input())
P = np.array(list(map(int, input().split())))
T = np.zeros(n)
T[0] = P[0]
for i in np.arange(1,n,1):
    T[i] = min(T[i-1], P[i])
print(np.sum(P==T))
# Judge status: Wrong Answer
s = list(input())
answer = []

for i in s:
        if  i == "B":
            try:
                answer.pop()
            except IndexError:
                pass
        else:
            answer.append(i)

print(" ".join(answer))
# Judge status: Accepted
N, M = map(int, input().split())

if N >= 3 and M >= 3:
    print((N-2)*(M-2))
elif N == 2 or M == 2:
    print(0)
else:
    print(max(N - 2, M - 2, 1))
# Judge status: Wrong Answer
a, b, c, x, y = (int(each) for each in input().split())

cost = [x*a + y*b]
for i in range(max(x, y)*2):
    numofabpizza = i*2
    numofapizza = max(0, (x-numofabpizza))
    numofbpizza = max(0, (y-numofabpizza))
    # print(numofapizza, numofbpizza, numofabpizza)
    cost.append(numofapizza*a + numofbpizza*b + (2*numofabpizza)*c)
# print(cost)
print(min(cost))
# Judge status: Accepted

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [abs(A-(T - i * 0.006)) for i in H]

print(list.index(min(list))+1)
# Judge status: Accepted
a,b,c = map(int,input().split())

if a-b == b-c:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N, K, S = map(int, input().split())

for i in range(N):
  if 0 < K:
    print(S)
    K-=1
  else:
    if S-1 < 100:
      print(S+1)
    else:
      print(S-1)
# Judge status: Accepted
s = list(input())
ans = "Good"
for i in range(len(s) - 1):
    if s[i] != s[i+1]:
        continue
    ans = "Bad"
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
x = list(map(int, input().split()))
ans = 10 ** 16
for i in range(n-k+1):
    if x[i] * x[i+k-1] < 0:
        dis = min(abs(x[i]), abs(x[i+k-1])) * 2 + max(abs(x[i]), abs(x[i+k-1]))
    else:
        dis = max(abs(x[i]), abs(x[i+k-1]))
    ans = min(ans, dis)
print(ans)
# Judge status: Accepted
H = int(input())

index = 0
while(H!=1):
    H //= 2
    index += 1

print(2**(index+1)-1)
# Judge status: Accepted
k=int(input())
a=7
for i in range(10**6):
    if a%k==0:
        print(i+1)
        exit()
    a=(a*10+7)%k
print(-1)
# Judge status: Wrong Answer
x, y, z = map(int, input().split())
print(y, x, z)
# Judge status: Wrong Answer
s=input()
i=s.find('A')
j=s.rfind('Z')

print(i)
print(j)

print(abs(i-j+1))
# Judge status: Accepted
a=int(input())
s=input()
if a >= 3200:
    print(s)
else:
    print("red")
# Judge status: Wrong Answer
l=[3,5,7]
print("Yes" if int(input()) in l else "No" )
# Judge status: Accepted
N = int(input())


def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
kou=N
a= num2alpha(kou)   

print(a.lower())
# Judge status: Wrong Answer
K,A,B = map(int,input().split())

if A < B:
  ans = 0
  K += 1
  while A < K:
    K -= A
    K -= 1
    ans += B
  ans += K
  print(ans)
else:
  print(K+1)