peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a==b:
    print('Draw')

elif a==1 or a>b:
    print('Alice')

elif b==1 or a<b:
    print('Bob')
# Judge status: Wrong Answer
s = input()

if len(s) == 1:
    print(1)
    exit()


now = s[0]
cnt = 1
i = 1
while True:
    if s[i] != now:
        cnt += 1
        now = s[i]
        i += 1
    else:
        now = now + s[i]
        cnt += 1
        i += 2
        if i > len(s)-1:
            cnt -= 1
    if i >= len(s):
        break
print(cnt)
# Judge status: Wrong Answer
n,x = map(int,input().split())
l = list(map(int,input().split()))

#print(l)

a = [0]

for i in range(n):
    a.append(a[i] + l[i])
#    print(a)


for j in range(len(a)):
    if a[j] <= x:
        if j == len(a):
            print(len(a))
        pass
    else:
        print(j)
        break
# Judge status: Accepted
N, A, B = map(int, input().split())
print(max(B*(N-2)-A*(N-2)+1, 0))
# Judge status: Accepted
s = list(input())
ans = float('inf')

for i in range(len(s)-2):
  num = int("".join(s[i:i+3]))
  if abs(ans) > abs(num-753):
    ans = abs(num-753)
print(ans)
# Judge status: Accepted
import numpy as np
n = int(input())
a_ls = list(map(int, input().split()))

sum_ls = list(np.cumsum(a_ls))
sum_ls.insert(0,0)

ans = float('inf')
for i in range(1,n):
    su = sum_ls[i]
    ara = sum_ls[-1] - sum_ls[i]
    dif = abs(su-ara)
    if dif < ans:
        ans = dif

print(ans)
# Judge status: Wrong Answer
def gcd(a,b):#最大公約数を返す。Euclid
    if a<b:
        a,b=b,a
    c=a%b
    if c==0:
        return b
    return gcd(b,c)
A,B,C,D=map(int,input().split())

#nc=B//C-(A-1)//C
nc=int(B/C)-int((A-1)/C)
#nd=B//D-(A-1)//D
nd=int(B/D)-int((A-1)/D)
cd=int(C*D/gcd(C,D))
#ncd=B//cd-(A-1)//cd
ncd=int(B/cd)-int((A-1)/cd)
print(B-A+1-nc-nd+ncd)
# Judge status: Accepted
A,B,C,x,y = map(int,input().split())
a = 0
b = 0
c = 0
if C*2 >= A + B:
    print (A*x+B*y)
    exit(0)

if C * 2 <= A and C * 2 <= B:
    print (max(x,y) * 2 * C)
    exit(0)

if x > y:
    if A >= C * 2:
        c = x * 2
    else:
        c = y * 2
        a = (x-y)
else:
    if B >= C * 2:
        c = y * 2
    else:
        c = x * 2
        b = (y-x)
print(A*a + B*b + C*c)
# Judge status: Accepted
n = int(input())
d = {}
ans = 0
for _ in range(n):
    s = list(input())
    s.sort()
    s = "".join(s)
    if s in d:
        d[s] += 1
        ans += d[s]
    else:
        d.update({s : 0})
print(ans)
# Judge status: Accepted
S = input()

count = 0
for i in range(len(S)//2):
    if S[i] != S[len(S)-1-i]:
        count += 1

print(count)
# Judge status: Wrong Answer
import heapq 

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

for _ in range(M):
  B, C = map(int, input().split())
  A += B * [C]
# Judge status: Wrong Answer
N=int(input())
sum=0
A=int(input())
sum+=A//2
a=A%2
for _ in range(N-1):
    A=int(input())
    sum+=A//2
    b=A%2
    m=min(a,b)
    if m>0:
        sum+=m
        b-=m
    a=b
print(sum)
# Judge status: Accepted
s=input()
ans = 0
if "R" in s:
  ans = 1
if s[0] == s[1] == "R":
  ans += 1
if s[1] == s[2] == "R":
  ans += 1
print(ans)
# Judge status: Accepted
def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b)
ans = 1
def fact(n):
    global ans
    p = 2
    while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
    if n!= 1:
        ans += 1
a,b = map(int, input().split())
g = gcd(a,b)
fact(g)
print(ans)
# Judge status: Wrong Answer
N = int(input())
count = 0
for i in range(N):
    a, b = map(int, input().split())
    if a == b:
        count += 1
if count >= 3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,r=map(int,input().split())
if n<10:
  print(r-100*(10-n))
else:
  print(r)
# Judge status: Accepted
n = int(input())
robots = []
for _ in range(n):
    x, l = map(int, input().split())
    robots.append([x-l, x+l])

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

cnt = 1
current_end = robots[0][1]
for i in range(1, n):
    if current_end <= robots[i][0]:
        cnt += 1
        current_end = robots[i][1]

print(cnt)
# Judge status: Accepted
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,X,Y = map(int,readline().split())
ans = [0]*N
for i in range(1,N):
    for j in range(i+1,N+1):
        dist = min(j-i,abs(i-X)+1+abs(j-Y),abs(i-Y)+1+abs(j-X))
        ans[dist]+=1
print('\n'.join(str(n) for n in ans[1:]))
# Judge status: Accepted
c=input()
if c in ['a','e','i','o','u']:
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
L = int(input())
k = L/3
print(k**3)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
R = list(set(L))
L.sort()
R.sort()
M = len(R)
ans = 0
if M <= 2:
    print(ans)
else:
    for i in range(N):
        for j in range(N):
            for k in range(N):
                if L[i] + L[j] > L[k] and L[i] < L[j] and L[j] < L[k]:
                    ans += 1
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
print((n-1)//k+1)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = Counter(list(map(int, input().split())))
a = [list(x) for x in a.items() if x[1]>=2]
a.sort(reverse=True, key=lambda x: (x[0], x[1]))
count = 0
base = 4
for i in range(len(a)):
    if count == 1:
        print(l*a[i][0])
        exit()
    else:
        l = a[i][0]
        count += 1

    if a[i][1]>=4:
        print(a[i][0]*a[i][0])
        exit()

print(0)
# Judge status: Accepted
N, W = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(N)]

dp = [[-1 for _ in range(W + 1)] for _ in range(N + 1)]
for i in dp:
    i[0] = 0
dp[0] = [0 for _ in range(W + 1)]

for i in range(1, N + 1):
    for l in range(1, W + 1):
        if l - wv[i - 1][0] < 0:
            dp[i][l] = dp[i - 1][l]
        else:
            dp[i][l] = max(dp[i - 1][l], dp[i - 1][l - wv[i - 1][0]] + wv[i - 1][1])
print(dp[N][W])
# Judge status: Wrong Answer
k = int(input())
s = 0
for x in range(1, k + 1):
  for y in range(x, k + 1):
    if y % 2 == 1 and x % 2 == 0:
      s = s + 1
print(s)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
d={}
for a in l:
    if a in d:
        d[a]+=1
    else:
        d[a]=1
ks=sorted(d,reverse=True)
f=0
for i,k in enumerate(ks):
    if d[k]>=4:
        print(k*k)
        exit()
    if d[k]>=2:
        f=k
        break
s=0
for k in ks[i+1:]:
    if d[k]>=2:
        s=k
        break
print(f*s)
# Judge status: Accepted
d=int(input())
ans=["Christmas","Christmas Eve","Christmas Eve Eve","Christmas Eve Eve Eve"]
print(ans[25-d])
# Judge status: Accepted
n = int(input())
nbase = n+0
if n % 2 == 1:
    ans = 0
else:
    ns = 0
    while n != 0:
        n = n//5
        ns += 1

    nsa = ns - 1
    ans = 0
    for i in range(nsa,0,-1):
        o = nbase//(5**i)
        ans += o//2

print(ans)
# Judge status: Accepted
n = int(input())
if n > 999:
  print('ABD')
else:
  print('ABC')
# Judge status: Wrong Answer
x = int(input())
d, m = divmod(x, 11)
ans = d * 2
if m > 5:
  ans += 2
elif m > 0:
  ans += 1
print(ans)
# Judge status: Wrong Answer
n = int(input())
for i in range(n):
    if(i**2>n):
        print((i-1)**2)
        quit()
# Judge status: Wrong Answer
#!/usr/bin/env python3

def main():
    n, k = map(int, input().split())
    arrdict = {}
    for i in range(n):
        a, b = map(int, input().split())
        if a in arrdict:
            arrdict[a] = arrdict[a] + b
        else:
            arrdict[a] = b

    for key, v in arrdict.items():
        k -= v
        if k <= 0:
            ans = key
            break
    print(ans)


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

start = [[0, 1000], [0, 1000]]
#0: all stack, 1: all money
max_index = A.index(max(A))

ans = 0
for i in range(N):
  if i == max_index:
    ans = start[0][0] * A[i] + start[0][1]
  else:
    money = max([
      start[0][0] * A[i] + start[0][1],  start[1][0] * A[i] + start[1][1]
    ])
    start = [[money//A[i], money - (money//A[i])*A[i] ],  [0, money]]
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 1000):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)
# Judge status: Accepted
a,b,c,d = map(int,input().split())

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

def f(e):
   return e - (e//c + e//d - e//(c*d//gcd(c,d)))

print(f(b)-f(a-1))
# Judge status: Wrong Answer
n = int(input())
heights = list(map(int, input().split()))

ans_list = [0]*n
for i in range(n):
  if i == 0:
    continue
  else:
    if heights[i] <= heights[i-1]:
      ans_list[i] = ans_list[i-1]
    else:
      ans_list[i] = 0
      
ans_list.sort()
ans = ans_list[-1]
print(ans)
# Judge status: Accepted
total = 0
N = input()
for c in N:
  total += int(c)
if total % 9 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = list(map(int, input().split()))

ASOBU = sum(A) - N

if ASOBU >= 0:
    print(ASOBU)
else:
    print('-1')
# Judge status: Accepted
num_array = list(map(int, input().split()))
if num_array[0] <= num_array[2] and num_array[2] <= num_array[1]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
res = 0
for i in range(100000):
    if i * i <= n:
        res = i * i
    else:
        break

print(res)
# Judge status: Wrong Answer
import math
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
sum_hen=0
for i in range(n-1):
    for j in range(i+1,n):
        x_i,y_i=l[i][0],l[i][1]
        x_j,y_j=l[j][0],l[j][1]
        sum_hen+=((x_i-x_j)**2+(y_i-y_j)**2)**0.5
print(sum_hen*2/(n*(n-1)))
# Judge status: Accepted
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


n = int(input())
s = input()

a = []

for i in range(n+1):
    a.append(len(set(s[:i]) & set(s[i:])))
print(max(a))
# Judge status: Wrong Answer
import math
wanted = int(input())
year = 0
if wanted >= 101 and wanted <= 1000000000000000000:
    year = math.log(wanted/100) / math.log(1.01)
    print(year)
else:
    print()
# Judge status: Accepted
def resolve():
    n, m, k = map(int, input().split())
    for x in range(n + 1):
        for y in range(m + 1):
            met = y * (n - x) + x * (m - y)
            if met == k:
                print('Yes')
                return

    print('No')
resolve()
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
n=int(input())
L=input()
F=[]
for i in range(len(L)):
    A=ord(L[i])+n
    if A>=91:
        A=A-91+65
    F.append(chr(A))
print("".join(F))
# Judge status: Accepted
N ,K = map(int,input().split())
D = [int(n) for n in input().split()]

flag = False

for i in range(N,100000):
    N = i
    while i > 0:
        flag = True
        if i%10 in D:
            flag = False
            break
        else:
            i //=10

    if flag == True:
        print(N)
        break
# Judge status: Accepted
A, B, K = map(int, input().split())
if A+K-1>=B-K+1:
    print(*list(range(A,B+1)),sep="\n")
else:
    print(*(list(range(A,A+K))+list(range(B-K+1,B+1))),sep="\n")
# Judge status: Wrong Answer
N=int(input())
data = list(map(int, input().split()))
ans=0
min=data[0]
if N==1:
    ans=1
elif N>1:
    for i in range(1,N):
        minmin=data[0]
        if data[i]<=minmin:
            minmin=data[i]
            if minmin<=data[i]:
                ans+=1
                continue
        if minmin<=data[i]:
            ans+=1

print(ans)
# Judge status: Accepted
n = int(input())
s = input()
rw = s.count(".")
lb = 0
M = rw+lb
for i in range(n):
    if s[i] =="#":
        lb += 1
    else:
        rw -= 1
    M = min(M,rw+lb)
print(M)
# Judge status: Accepted
import sys
input = sys.stdin.readline
import math
import collections
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n,d=MI()
ans=math.ceil(n/(2*d+1))
print(ans)
# Judge status: Wrong Answer
print(*[o + e for o, e in zip(input(), input())], sep='', end='')
# Judge status: Wrong Answer
import math
a = int(input())
print(math.pi * a *a)
# Judge status: Wrong Answer
A,B=map(int,input().split())
count = 0
tap = 1
for i in range(30):
  tap += A-1
  count += 1
  if tap >= B:
    break
print(count)
# Judge status: Wrong Answer
input()
A=list(map(int,input().split()))
print("APPROVED" if all(a%2==0 or a%3==0 or a%5==0 for a in A) else "DENIED")
# Judge status: Accepted
s = input()
s_r = s[::-1]
count = 0
for i in range(len(s)):
    if s[i] != s_r[i]:
        count += 1
print(count//2)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

four = 0
two = 0
other = 0
for i in a:
    if i % 4 == 0:
        four += 1
    elif i % 2 == 0:
        two += 1
    else:
        other += 1

ans = 'No'
other += two % 2
if four + 1 >= other:
    ans = 'Yes'

print(ans)
# Judge status: Accepted
x = input()
ans = len(x)
cs = 0
T = False

for i in x:
  if i == 'S':
    if T:
      T = False
    cs += 1
  else:
    if not T:
      T = True
    if cs > 0:
      cs -= 1
      ans -= 2
print(ans)
# Judge status: Accepted
import collections

ss = []


N = int(input())
for i in range(N):
    s = str(sorted(input()))
    ss.append(s)

c = collections.Counter(ss)
ans = 0

for v in c.values():
    ans += v * (v - 1) // 2
print(ans)
# Judge status: Accepted
w, h, n = map(int,input().split())

xl, xr = 0, w
yl, yu = 0, h
for i in range(n):
    x, y, a = map(int,input().split())
    if a == 1:
        xl = max(xl, x)
    elif a == 2:
        xr = min(xr, x)
    elif a == 3:
        yl = max(yl, y)
    else:
        yu = min(yu, y)
        
print((xr-xl)*(yu-yl)) if xl < xr and yl < yu else print(0)
# Judge status: Wrong Answer
s=input()
if sorted(s)=="abc":
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
abcd=str(input())
for i in range(2**4):
    list=[int(abcd[0])]
    symbol=[]
    for j in range(1,4):
        if (i>>j)&1==True:
            list.append(int(abcd[j]))
            symbol.append('+')
        else:
            list.append(int(abcd[j])*(-1))
            symbol.append('-')
    if sum(list)==7:
        print(abcd[0],symbol[0],abcd[1],symbol[1],abcd[2],symbol[2],abcd[3],"=7")
        break
# Judge status: Accepted
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    H = int(input())
    ans = 0
    i = 0
    while(H >= 1):
        ans += 2**i
        H /= 2
        i += 1

    print(ans)
    

if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
print(sum(h[0:n-k]) if n > k else 0)
# Judge status: Accepted
n = int(input())

a =[]
for i in range(n):
    s, p = input().split()
    p = int(p)
    a.append([s, -p, i + 1])
    
a.sort()
for s, p, i in a:
    print(i)
# Judge status: Accepted
n, k = map(int, input().split())
s = input()
sep = sum(a != b for a, b in zip(s, s[1:]))
print(n - max(0, sep - 2 * k) - 1)
# Judge status: Accepted
A, B, C = map(int, input().split())


def F(a, b, c):
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        return 0
    if a == b == c:
        return -1
    return F((a + b) // 2, (b + c) // 2, (c + a) // 2) + 1


print(F(A, B, C))
# Judge status: Accepted
N=int(input())


Sum=[]
Sub=[]
for _ in range(N):
    x,y = map(int,input().split())
    Sum.append(x+y)
    Sub.append(x-y)

Sum = sorted(Sum)
Sub=sorted(Sub)
ans=max(abs(Sum[-1]-Sum[0]),abs(Sub[-1]-Sub[0]))
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print ("Yes") if a < c < b else print ("No")
# Judge status: Wrong Answer
#スペース区切りの整数の入力
tairyoku_A, kougeki_B,tairyoku_C,kougeki_D = map(int, input().split())

one = int(tairyoku_A /kougeki_D)
two = int(tairyoku_C /kougeki_B)


if(one>two):
  print("Yes")
elif(one<two):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
S = input()
ans = [0 for i in range(len(S)+1)]
 
for i in range(len(S)):
    if S[i] == "<":
        ans[i+1] = ans[i]+1

 
for i in range(len(S)):
    if S[len(S)-i-1] == ">":
        ans[len(S)-i-1] = max(ans[len(S)-i-1], ans[len(S)-i]+1)
 
print(sum(ans))
# Judge status: Accepted
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

S=input()
cnt=0
for i in range(len(S)//2):
    if S[i]!=S[-1-i]:
        cnt+=1
    
print(cnt)
# Judge status: Accepted
N = str(input())

if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    result = "Yes"
else:
    result = "No"

print(result)
# Judge status: Wrong Answer
n = int(input())
b = list(map(int, input().split()))
a = [0] * (n + 1)
for i in range(1, n + 1):
    a[i] = b[i - 1]


ball = [0] * (n + 1)
ans = []

for i in range(n, 0, -1):
    s = 0
    j = i * 2
    while j < n:
        s += ball[j]
        j += i

    if s % 2 != a[i]:
        ball[i] += 1
        ans.append(i)

print(len(ans))
for e in ans:
    print(e)
# Judge status: Wrong Answer
d,e,f = map(int,input().split())
print(f,e,d)
# Judge status: Wrong Answer
a=4
b=8

print(a*b)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
count=0
while all( [a%2==0 for a in A]):
    A=[a/2 for a in A]
    count+=1

print(count)
# Judge status: Accepted
x, y = list(map(int, input().split()))

dif = abs(abs(x)-abs(y))

if (x >= 0 and y > 0) or (x < 0 and y <= 0):
    if x < y:
        print(dif)
    else:
        print(dif + 2)
else:
    print(dif + 1)
# Judge status: Wrong Answer
T=str(input())
cnt=0
count=len(T)
for i in T:
    if i=='P':
        cnt=1
        print('P',end='')

    elif i=='D':
        cnt=0
        print('D', end='')
    else:
        if count == i:
            print('D')

        elif cnt==1:
            cnt=0
            print('D', end='')
        else:
            cnt=1
            print('P', end='')
# Judge status: Accepted
x,k,d = map(int,input().split())
c = abs(x)//d
if c < k:
    if (k-c) % 2 == 0:
        print(abs(x)%d)
    else:
        print(min(abs(abs(x)%d+d),abs(abs(x)%d-d)))
else:
    print(abs(x)-d*k)
# Judge status: Wrong Answer
import numpy as np
import itertools
n = int(input())
a = list(map(int, input().split()))

i = list(itertools.accumulate(a))

idx = np.abs(np.asarray(i) - sum(a) / 2).argmin()
if n == 2:
    print(abs(a[0] - a[1]))
    exit()
print(abs(i[idx] - (sum(a) - i[idx])))
# Judge status: Accepted
#デフォルト
import itertools
from collections import defaultdict
import collections
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

t = list(input())

for i in range(len(t)):
    if (t[i] == "?"):
        print("D",end="")
    else:
        print(t[i],end="")
# Judge status: Accepted
a=list(map(int,input().split()))

five=a.count(5)
seven=a.count(7)

if five==2 and seven==1:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
X = int(input())

q,mod = divmod(X,100)
if 5*q<mod:
  print(0)
else:
  print(1)
# Judge status: Accepted
print("Yes"if int(input())>=30 else "No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

flag = [0]*9
t = 0
x = 0
y = 400
while y <= 3200:
  for i in a:
    if x <= i < y: flag[t] = 1
  t += 1
  x += 400
  y += 400
else:
  for i in a:
    if 3200 <= i: flag[8] += 1

if sum(flag[:8]) == 0:
  print(1,flag[8])
  exit()
      
total = sum(flag)
print(total - flag[8], total)
# Judge status: Accepted
a,b,c=map(int,input().split())
print("Yes" if (a+b>=c) else "No")
# Judge status: Accepted
s=input()
T=input()
ans=[]
for i in range(len(s)-len(T)+1):
  flag=True
  S=s[:i]+T+s[i+len(T):]
  for j in range(len(T)):
    if(s[i+j]!="?" and s[i+j]!=T[j]):
      flag=False
  if(flag==True):
    S.replace("?","a")
    #print(S)
    ans.append(S.replace("?","a"))

if(ans):
  ans.sort()
  print(ans[0])
else:
  print("UNRESTORABLE")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import math

N,K = list(map(int,input().split()))

#A = max(N,K)
#B = min(N,K)

#sre = (1/(4*M))*sum(A)

def hoge(K):
    init_i = math.floor(N/K)

    p1 = abs(N - (init_i-1) * K)
    p = abs(N - init_i * K)
    m = abs((init_i+1) * K - N)

    return min(p1,p,m)

ks = []
tmp_K = K

while(1):
    tmp_K = hoge(tmp_K)
    ks.append(tmp_K)
    if tmp_K == 0 or tmp_K in ks:
        break

print(min(ks))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(0,n,2):
  if a[i]%2==1:
    ans+=1
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int,input().split())

print('Yes' if A<=C<=B else 'No')
# Judge status: Wrong Answer

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

if (b//a) <= c:
    print(c)
else:
    print(b//a)
# Judge status: Wrong Answer
n = int(input())
ans = 0
for i in range(30):
    for j in range(20):
        if 4*i + 7*j == n :
            ans +=1 
print(ans)
# Judge status: Wrong Answer
N = int(input())
for i in range(1, int(N**0.5)+1, -1):
  if N % i == 0:
    print(i + (N // i) - 2)
    break
# Judge status: Accepted
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
p = 1
for i in range(n):
    d += l[i]
    if d <= x:
        p += 1
print(p)
# Judge status: Wrong Answer
d, n = list(map(int, input().split()))
work = list(map(int, input().split()))
sumwork = sum(work)
ans = d - sumwork
print(ans)
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))
ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            x, y, z = L[i], L[j], L[k]
            if x != y and x != z and y != z:
                if max(x, y, z) < x + y + z - max(x, y, z):
                    ans += 1
print(ans)
# Judge status: Accepted
x, a, b = map(int,input().split())

if abs(a-x) > abs(b-x):
  print("B")
else:
  print("A")
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,A,B=map(int,readline().split())
    if (B-A)%2==0:
        print((B-A)//2)
    else:
        print(min(N-B,A-1)+1+(B-A-1)//2)

if __name__=="__main__":
    main()
# Judge status: Accepted
x=int(input())
for i in range(1,x+1):
    if x<=(i*(i+1))//2:
        print(i)
        break
# Judge status: Accepted
N,X=map(int,input().split())
x=input().split()
x_s=[int(a) for a in x]

x_s.append(X)

list_s=sorted(x_s)

numbers=[]

for n in range(1,N+1):
    number=list_s[n]-list_s[n-1]
    numbers.append(number)

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

number=numbers[0]
for n in range(len(numbers)):
    number=gcd(number,numbers[n])

print(number)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
s1 = sum(a) - a[0]
s2 = a[0]
m = abs(s1-s2)
for i in range(1,n-1):
    s1 -= a[i]
    s2 += a[i]
    m = min(m,abs(s1-s2))
print(m)
# Judge status: Wrong Answer
S = input()
C = ['1', '0']
c = S[0]
cnt = 0
for i in range(1, len(S) - 1):
    if c == S[i]:
        c = C[ord(c) - ord('0')]
        cnt += 1
    else:
        c = S[i]
print(cnt)
# Judge status: Accepted
N,M = map(int,input().split())

answer1 = N * (N - 1) / 2
answer2 = M * (M - 1) / 2

print(int(answer1 + answer2))
# Judge status: Accepted
a,b,c = map(int, input().split())
print('YES' if b-a==c-b else 'NO')
# Judge status: Accepted
a,b=map(int,input().split())
if max(a,b)<10:print(a*b)
else:print(-1)
# Judge status: Wrong Answer
x, k, d = map(int, input().split())
ans = pow(10, 16)
if x // d  + 1> k:
    ans = abs(x - k*d)
else:
    ans = min(abs(x % d), d - abs(x % d))

print(ans)
# Judge status: Accepted
import math
n = int(input())
cnt = 0
for i in range(1, n + 1):
    if math.floor(math.log10(i) + 1) % 2:
        cnt += 1
print(cnt)
# Judge status: Accepted
k, a, b = map(int, input().split())
ans = 0
if b - a <= 1: # 叩き続けたほうがいい
    ans = k + 1
else:
    n = k - a + 1 #a個
    if n % 2 == 1:
        ans = a + 1 + (b-a)*(n//2) #最後交換しない
    else:
        ans = a + (b-a)*(n//2) 
print(ans)