peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
x=int(input())
c=0
y,z,d=int(input()),int(input()),int(input())
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            f=500*i+100*j+50*k
            if(f==x):
                c+=1
print(c)
# Judge status: Accepted
n,k,x,y= int(input()),int(input()),int(input()),int(input())
if n <= k:print(n*x)
else :print(x*k + y *(n-k))
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n + 1):
    y = n // i
    ans += y * (y + 1) * i // 2
print(ans)
# Judge status: Accepted
data = {}
count = 0
max_num = 10**9
before = 0
while True:
    tmp = count**5
    data[count] = tmp
    data[-count] = -tmp
    count+=1
    if tmp - before > max_num:
        break
    before = tmp

x = int(input())
for k, v in data.items():
    for k2, v2 in data.items():
        if v - v2 == x:
            print(k, k2)
            exit()
# Judge status: Accepted
N = int(input())
s = input()
t = input()
kaburi = 0
if s == t:
  print(N)
else:
  for i in range(N):
    if s[-(i+1):] == t[0:i+1]:
      kaburi = len(s[-(i+1):])
  print(2*N-kaburi)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

if a+b >= c:
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
N, K = map(int, input().split())
a = abs(N-K)
print(min(a, abs(a-K)))
# Judge status: Accepted
N = int(input())
S = input()
direction = [{"E": 0, "W": 0} for _ in range(N + 1)]  # direcion[i]["E"] ... i番目までにEを向いている人数
ans = N
for i in range(N):
    direction[i + 1]["E"] = direction[i]["E"] + (1 if S[i] == "E" else 0)
    direction[i + 1]["W"] = direction[i]["W"] + (1 if S[i] == "W" else 0)
for i in range(N):
    ans = min(ans, direction[i]["W"] + direction[N]["E"] - direction[i + 1]["E"])
print(ans)
# Judge status: Wrong Answer
A,B,M = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
S = P
T = Q
S.sort()
T.sort()
minimum = (S[0]+T[0])
K = 10**9
for i in range(M):
    x,y,c = map(int,input().split())
    S = P[x-1]+Q[y-1]-c
    if S<K:
      X = S
if minimum<K:
    print(X)
else:
    print(minimum)
# Judge status: Accepted
A, B, C = map(int, input().split())
f = False
for i in range(1, B+1):
  if (i * A) % B == C:
    f = True
    break
print("YES" if f else "NO")
# Judge status: Wrong Answer
n, *lst = map(int, open(0).read().split())
if n < 3:
  print(1)
  quit()
group = 1
start = (lst[1] >= lst[0])
for i in range(2, n - 1):
  if (lst[i] >= lst[i - 1]) != start:
    start = (lst[i + 1] >= lst[i])
    group += 1
if (lst[-1] >= lst[-2]) != start:
  group += 1
print(group)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())
t = 0
x = 0
y = 0
judge = True

l = [list(map(int, input().split())) for _ in range(n)]

for t1, x1, y1 in l:
    if (abs(x1 - x) + abs(y1 - y))/(t1 - t) > 1 or (abs(x1 - x) + abs(y1 - y))%2 != (t1 - t)%2:
        print("No")
        exit()
    x = x1
    y = y1
    t = t1

print("Yes")
# Judge status: Accepted
S = list(input())
#print(S)
#print(len(S))

a=int((len(S)-1)/2)

def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

if is_kaibun(S) and is_kaibun(S[:a]) and is_kaibun(S[a+1:]):
        print('Yes')

else:
    print('No')
# Judge status: Accepted
X = int(input())
if X == 7 or X == 5 or X == 3:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
N,T=map(int,input().split())
p=[]
for _ in range(N):
  c=list(map(int,input().split()))
  p.append(c)
ans=9999
for c in p:
  if c[1]<T:
    if c[0]<ans:
      ans=c[0]
if ans==9999:
  print('TLE')
else:
  print(ans)
# Judge status: Accepted
#n = int(input())
d, n = map(int, input().split())
#al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]

if n==100:
    print(101*(100**d))
else:
    print(n*(100**d))
# Judge status: Wrong Answer
N = int(input())
a_list = list(map(int, input().split()))
dp = [0]*N 

if 1 not in a_list:
    print(-1)
else:
    dp[0]= 1
    count = 0
    for i in range(N-1):
        if dp[i] == a_list[i]:
            dp[i + 1] += 1
        else:
            dp[i + 1] = dp[i]
            count += 1
    print(count)
# Judge status: Accepted
n = int(input())
w = [int(i) for i in input().split()]
min_diff = 10 ** 100
for t in range(0, n - 1):
    diff_abs = abs(sum(w[:t + 1]) - sum(w[t + 1:]))
    if min_diff > diff_abs:
        min_diff = diff_abs
print(min_diff)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if p[i] != i+1:
    cnt += 1
if cnt == 0:
  print("YES")
elif cnt == 2:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
A,B,C,K=map(int,input().split())

t=A-B
if 10**18<t:
    print('Unfair')
elif K%2==0:
    print(t)
else:
    print(-t)
# Judge status: Wrong Answer
n,m=map(int,input().split())
ab=[]
ans=[]
for i in range(n):
    a,b=map(int,input().split())
    a=m-a
    ab.append((a,b))
ab.sort()
ab.sort(key=lambda x:x[1],reverse=True)
for i in range(n):
    a,b=ab[i][0],ab[i][1]
    if a>=len(ans):
        ans.append(b)
print(sum(ans))
# Judge status: Accepted
# D
from collections import Counter
n = int(input())
c = list(input())
d = Counter(c)
# print(d)
# print(d["R"])
e=Counter(c[:d["R"]])
# print(e["R"])
print(d["R"]-e["R"])
# Judge status: Accepted
n=int(input())
c=input()
w=c.count(".")
b=n-w
#全部黒にする場合
ans1=w
#全部白にする場合
ans2=b
"""
まずi=0とし、iを境に左にある黒の合計と右にある白の合計の最小を求める
"""
ans=ans1
tmp_b=0
tmp_w=w
for i in range(n):
    if c[i]==".":
        tmp_w-=1
    else:
        tmp_b+=1
    tmp_ans=tmp_b+tmp_w
    ans=min(ans,tmp_ans)
print(ans)
# Judge status: Wrong Answer
X = int(input())

flg = ''

for i in range(X, 2 * X):
  for j in range(2, i):
    if i % j == 0:
      break
    else:
      flg = True
      
  if flg == True:
    print(i)
    exit()
# Judge status: Wrong Answer
n=int(input())
list=[]
for i in range(32):
	for j in range(10):
		ans=i**j
		if ans<=n:
			list.append(ans)
print(max(list))
# Judge status: Wrong Answer
s = input()
counter = 0
buffer = 0
if not 'R' in s:
    print(0)
else:
    for i in range(len(s)):
        if s[i] == 'R':
            buffer += 1
        else:
            counter = buffer
            buffer = 0
        if buffer > counter:
            counter = buffer
    print(counter)
# Judge status: Accepted
a = list(map(int, input().split()))
 
print(min(a[0]+ a[1], a[1] + a[2], a[2]+ a[0]))
# Judge status: Wrong Answer
def car(n):
  if n==1:
    return 1
  elif n%2==0:
    return car(n//2)*2
  else:
    return car((n-1)//2)*2
  
N=int(input())
print(car(N))
# Judge status: Accepted
h,w,n=[input() for i in range(3)]
n = int(n)
w = int(w)
h = int(h)
if(h >= w):
  temp = h
elif(w > h):
  temp = w
if(n % temp != 0):
  temp = (n // temp)
  temp = temp + 1
else:
  temp = (n // temp)
print(temp)
# Judge status: Accepted
N, M = map(int, input().split())
Xlist = sorted(list(map(int, input().split())))
sbn = [Xlist[i+1]-Xlist[i] for i in range(M-1)]
sbn.sort()
# print(sbn)
ans = 0
if N < M:
    for i in range(M-N):
        ans += sbn[i]
print(ans)
# Judge status: Accepted
a,b,c,d = map(int, input().split())
res1 = a*b/2
res2 = 0
if c*2 == a and d*2 == b:
  res2 = 1
print(res1, res2)
# Judge status: Accepted
x=int(input())
for i in range(1,361):
  if 360*i % x == 0:
    print(int(360*i/x))
    exit()
# Judge status: Wrong Answer
def main():
    group_A = [1, 3, 5, 7, 8, 10, 12]
    group_B = [4, 6, 9, 11]
    group_C = [2]

    x, y = map(int, input().split())

    if x == 2 or y == 2:
        print("No")
    elif (x in group_A and y in group_A) or (x in group_B and y in group_B):
        print("Yes")
main()
# Judge status: Wrong Answer
s = input()

if s == 'SAT':
    print(1)
if s == 'FRY':
    print(2)
if s == 'THU':
    print(3)
if s == 'WED':
    print(4)
if s == 'TUE':
    print(5)
if s == 'MON':
    print(6)
if s == 'SUN':
    print(7)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans =1;
iszero = False

if 0 in A:
  iszero = True
for i in range(N):
  if(iszero):
    ans = 0
    break
  ans *= A[i] 
  if ans>10**18:
    ans = -1
    break

print(ans)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**6+1)
import math
n=int(input())
def f(x):
    if x==1:
        return 1
    elif x==0:
        return 0
    else:
        return f(x//10+math.floor((x%10)/6))+min(x%10,10-x%10)
print(f(n))
# Judge status: Wrong Answer
x,y = map(int,input().split())

ans = 0
if y < x:
  y = -y
  ans +=1
    
if x*y < 0:
  ans += 1 + abs(x+y)
else:
  ans += y-x
print(ans)
# Judge status: Accepted
n, x, t = map(int, input().split())

if n % x == 0:
    print(int(n / x * t))
else:
    print(int((n // x + 1) * t))
# Judge status: Wrong Answer
import math
X = int(input())
s = 0
for i in range(X+1,10**5):
    for j in range(2,math.ceil(i ** 0.5)):
        if i % j ==0:
            s += 1
    if s == 0:
        print(i)
        break
    else:
        s = 0
# Judge status: Accepted
s=[]
t=[]

n=int(input())
for i in range(n):
    s.append(input())
m=int(input())
for i in range(m):
    t.append(input())

word=set(s)

max_point = -101


for w in word:
    tmp=s.count(w)-t.count(w)
    if tmp >= max_point:
        max_point = tmp

if max_point < 0:
    print(0)
else:
    print(max_point)
# Judge status: Accepted
N=int(input())
B = list(map(int,input().split()))
C=0
C+=(B[0]+B[N-2])
if N>2:
 for i in range(N-2):
  C+=min(B[i],B[i+1])
print(C)
# Judge status: Accepted
a,b= input().split()
c = int(a + b)
if float.is_integer(c**0.5):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x,y,z = map(int,input().split())
x = x-z
print(x //(y+z))
# Judge status: Wrong Answer
if __name__ == '__main__':
    n = int(input())
    s =input()
    t = input()
    count = 2*n

    for i in range(n):
        if t[i] == s[n-i-1]:
            count-=1
        else:
            break
    print(count)
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
d = {}
for i in A:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
summ = 0
for i in d:
    summ += d[i] * (d[i] - 1) // 2
for i in A:
    print(summ - d[i] + 1)
# Judge status: Wrong Answer
import sys

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


def resolve():
    q, h, s, d = map(int, input().split())
    n = int(input())
    t = min(q // 0.25, h // 0.5, s)

    if n == 1:
        print(int(t))
    else:
        if n % 2 == 0:
            print(int(min(t * n, d * n // 2)))
        else:
            print(int(min(t * n, d * (n - 1) // 2 + t)))


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
v = list(sorted(map(int, input().split())))
v.append(2000)
total = n*(n-1)*(n-2) / 6



def bs(left, s):
    right = n+1
    while left < right-1:
        m = (right+left)//2

        if v[m]>=s:
            right = m
        else:
            left = m
    return left+1






for i, x in enumerate(v[:-2]):
    for j, y in enumerate(v[i+1:-1]):
        k = bs(j+1, y+x)
        total -= (n-k)

print(int(total))
# Judge status: Accepted
n = int(input())
mod = 10**9 + 7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod)) % mod)
# Judge status: Accepted
#!/usr/bin/env python3
s = input()
n = int(s)
for i in range(5):
    if n == 10**(i+1):
        print(10)
        exit()
        # 10**k の時
print(sum([int(i) for i in s]))
# Judge status: Accepted
def main():
    n, m = map(int, input().split())

    print(int(n*(n-1)/2 + m*(m-1)/2))


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
from fractions import gcd
def input(): return sys.stdin.readline().strip()


def main():
    N, X = map(int, input().split())
    x = list(map(int, input().split()))
    dist = [abs(X - y) for y in x]
    D = dist[0]
    for d in dist:
        D = gcd(D, d)
    print(D)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
r = int(input())
x = 3.14 * (r * r) / 3.14
print(int (x))
# Judge status: Accepted
def resolve():
	x, y, z = map(int, input().split())
	if x + y + z == 17:
		print("YES")
	else:
		print("NO")

resolve()
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
p=0
for i in range(n):
    p+=2*x[i]
  
p1=p//(2*n)
p2=p1+1

    
ans1=0
ans2=0
for j in range(n):
    ans1+=(x[j]-p1)**2
    ans2+=(x[j]-p2)**2
    
print(min(ans1,ans2))
# Judge status: Wrong Answer
N, K = tuple(map(int, input().split()))


x = K
cnt = 1
while x < N:
    x *= K
    cnt += 1
print(cnt)
# Judge status: Wrong Answer
N=int(input())
L=list(map(int,input().split()))
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L[i]!=L[j]!=L[k]:
                sum_=L[i]+L[j]+L[k]
                if max(L[i],L[j],L[k])*2<sum_:
                    count+=1                

print(count)
# Judge status: Accepted
n = int(input())
a,b,c=[0]*n,[0]*n,[0]*n

for i in range(n):
  a[i],b[i],c[i]=map(int,input().split())

dp=[[0]*3 for _ in range(n)]
dp[0]=[a[0],b[0],c[0]]

for i in range(0,n-1):
  dp[i+1][0]=max(dp[i+1][0],dp[i][1]+a[i+1],dp[i][2]+a[i+1])
  dp[i+1][1]=max(dp[i+1][1],dp[i][2]+b[i+1],dp[i][0]+b[i+1])
  dp[i+1][2]=max(dp[i+1][2],dp[i][0]+c[i+1],dp[i][1]+c[i+1])

print(max(dp[n-1]))
# Judge status: Wrong Answer
import collections
N,C,K=map(int,input().split())
T=[int(input()) for i in range(N)]
T.sort()

count=1
cus=0
pre=T[0]
for t in T:
    if C>cus and pre+K>t:
        cus+=1
    else:
        cus=1
        pre=t
        count+=1
print(count)
# Judge status: Accepted
a, b = map(int, input().split())
if a<=b:
    print(a)
else :
    print(a-1)
# Judge status: Wrong Answer
from sys import stdin
input = stdin.readline
N=int(input())
A = list(map(int, input().split()))
for n in range(N):
    print(A.count(str(n+1)))
# Judge status: Wrong Answer
X=int(input())
a=360%X
if a==0:
  print(a)
else:
  print(360)
# Judge status: Accepted
n=int(input())
alis=list(map(int,input().split()))
for i in range(n):
  
  if alis[i]%2==0:
    if alis[i]%3!=0 and alis[i]%5!=0:
      print('DENIED')
      exit()

print('APPROVED')
# Judge status: Accepted
N = int(input())
S = []
for _ in range(N):
    S.append(input())
T = sorted(S)
T.append("uuuuuuuuuuuuu")
s = 0
t = 0
u = 0
d = []
for i in range(0,N):
    if T[i] != T[i+1]:
        s = i + 1 -t
        t = i + 1
        if s > u:
            d = [T[i]]
            u = s
        elif s == u:
            d.append(T[i])
            u = s
s_n = '\n'.join(d)
print(s_n)
# Judge status: Accepted
hw,hh,n=map(int,input().split())
lw=lh=0
for _ in range(n):
  x,y,a=map(int,input().split())
  if a==1:
    lw=max(lw,x)
  elif a==2:
    hw=min(hw,x)
  elif a==3:
    lh=max(lh,y)
  else:
    hh=min(hh,y)
print(max(hh-lh,0)*max(hw-lw,0))
# Judge status: Wrong Answer
n = input()
a = input().split()

n = int(n)
a = [int(i) for i in a]
m_ = []

for i in range(0,n):
  if(a[i] not in m_):
    m_.append(a[i])
  else:
    continue

m = int(sum(m_)/len(m_))

x = 0
for i in range(0,n):
  x = (a[i] - m)**2 + x
  
print(m)
# Judge status: Accepted
n = int(input())
spi = []
for i in range(n):
    s,p = input().split()
    spi.append([s,int(p), i+1])
spi.sort()
before = spi[0][0]
ans = [spi[0][2]]
for s,p,i in spi[1:]:
    if s == before:
        ans.append(i)
    else:
        for x in ans[::-1]:
            print(x)
        before = s
        ans = [i]
for x in ans[::-1]:
    print(x)
# Judge status: Wrong Answer
a,b,t = map(int, raw_input().split(' '))
print b*t/a
# Judge status: Accepted
N = int(input())
S = input()
print('Yes' if S[:N//2] == S[N//2:] else 'No')
# Judge status: Wrong Answer
a=int(input())
b=input()
if a>=3200:
  print(b)
  
else:
  print(a)
# Judge status: Accepted
N = int(input())

i=0
while pow(2,i)<=N:
    i+=1
print(pow(2,(i-1)))
# Judge status: Accepted
X,Y,A,B,C = map(int,input().split())
R = list(map(int,input().split()))
G = list(map(int,input().split()))
T = list(map(int,input().split()))
R.sort(reverse=True)
G.sort(reverse=True)
R = R[:X]
G = G[:Y]
A = T+R+G
A.sort(reverse=True)
print(sum(A[:X+Y]))
# Judge status: Wrong Answer
from fractions import gcd

a, b = [int(i) for i in input().split()]

print((a*b)/gcd(a,b))
# Judge status: Wrong Answer
S = input()

odd = list(S[::2])
even = list(S[1::2])
x = "No"

for i in range(len(odd)):
  if odd[i] == "R" or "U" or "D":
    x = "Yes"
  
for i in range(len(even)):
  if even[i] == "L" or "U" or "D":
    x = "Yes"
  
print(x)
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split(' '))

mo = h1 * 60 + m1
ni = h2 * 60 + m2

ti = ni - mo - k
print(ti)
# Judge status: Accepted
x,y,a,b,c= map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
li=p[:x]+q[:y]
li.sort()
ans=sum(li)
for i in range(min((x+y),c)):
    if li[i]<r[i]:
        ans+=r[i]-li[i]
    else:
        break
print(ans)
# Judge status: Accepted
N=int(input())
As = list(map(int,input().split()))

MAX=10**18
ans = 1
fover=False
fzero=False
for A in As:
    if A==0:
        fzero=True
        break
    if not fover:
        ans *= A
        if ans > MAX:
            fover=True

if fzero:
    print(0)
elif fover:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
n, k = map(int, input().split())
p = list(map(int, input().split()))

total_expects = []
# 1回のサイコロについて
for i in range(0, n):    
    # 1個のサイコロの期待値リスト
    expect = [q * (1 / p[i]) for q in range(1, p[i]+1)]
    total_expects.append(sum(expect))

max_k_expect = 0
for i in range(0, k):
    if max_k_expect < sum(total_expects[i:i+k]):
        max_k_expect = sum(total_expects[i:i+k])
print(max_k_expect)
# Judge status: Accepted
D = int(input())
print("Christmas" + " Eve"*(25-D))
# Judge status: Wrong Answer
S=str(input())

if S=='SUN':
    print(int(7-0))
elif S=='MON':
    print(int(7-1))
elif S=='TUE':
    print(int(7-2))
elif S=='WEN':
    print(int(7-3))
elif S=='THU':
    print(int(7-4))
elif S=='FRY':
    print(int(7-5))
elif S=='SAT':
    print(int(7-6))
# Judge status: Wrong Answer
li=a,b,c=list(map(int,input().split()))
if li.count(7)==2 and li.count(5)==1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n,m=map(int,input().split())
print(int((n*(n-1)/2 + m*(m-1)*2)))
# Judge status: Wrong Answer
x,k,d=map(int,input().split())
a=divmod(abs(x),d)  
if x==0:
  if k%2==0:
    print(0)
  else:
    print(d)
else:
  if a[0]<k:
    if a[1]==0 and a[0]%2==1:
      print(d)
    elif a[1]==0 and a[0]%2==0:
      print(0)
    elif a[1]!=0 and a[0]%2!=0:
      print(d-a[1])
      
    else:
      print(a[1])
  else:
    print(abs(x)-d*k)
# Judge status: Wrong Answer
X = input()

t, s = 0, 0
flag_t, flag_s = True, True
for i in range(len(X)):

    if flag_t:
        if X[i] == 'T':
            t += 1
        else:
            flag_t = False

    if flag_s:
        if X[-(i+1)] == 'S':
            s += 1
        else:
            flag_s = False

    if flag_t==False and flag_s==False:
        break

print(max(t, s)*2)
# Judge status: Wrong Answer
from collections import Counter
n = list(map(int, input()))
c = Counter(n)
d = c.most_common()
if d[0][1] == 3 or d[0][1] == 4:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
from sys import stdin 
n,m = [int(x) for x in stdin.readline().rstrip().split()]
a = []
for i in range(m):
    a.append([x for x in stdin.readline().rstrip().split()])
ac = [0] * n
wa = [0] * n
WA = 0
for i in range(m):
    if a[i][1] == 'WA':
        wa[int(a[i][0])-1] += 1
    if a[i][1] == 'AC':
        ac[int(a[i][0])-1] = 1
        WA += wa[int(a[i][0])-1]
print(sum(ac),WA)
# Judge status: Accepted
import itertools
import math
import fractions
import functools
import copy

x, y = map(int, input().split())
print(x+y//2)
# Judge status: Accepted
from sys import stdin
def LI(): return list(map(int,stdin.readline().rstrip().split()))

tmp = LI()
for i in range(2):
    if tmp[i]==1:
        tmp[i] = 999

a,b = [tmp.pop(0) for _ in range(2)]

if a<b:
    print('Bob')
elif b<a:
    print('Alice')
else:
    print('Draw')
# Judge status: Accepted
s=sorted(list(map(int,input().split())))
print(s[0]+s[1])
# Judge status: Accepted
r = [[] for _ in range(200001)] 
n, m = map(int, input().split())

for _ in range(m):
    a, b = map(int, input().split())
    r[a].append(b)

k = [1]
flag = 0
for _ in range(2):
    if flag == 1:
        break
    for j in k:
        kk = []
        kk += r[j]
        if n in r[j]:
            flag = 1
            break
    k = kk[:]

if flag == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N, K = map(int, input().split())

result = 0
while N > 0:
    N //= K
    result += 1

print(result)
# Judge status: Wrong Answer
N = int(input())
L = [0]*(N+2)
L[0] = 2
L[1] = 1
if N<=2:
    print(L[N-1])
else:
    for i in range(2,N+1):
        L[i] = L[i-1]+L[i-2]
    print(L[N])
# Judge status: Accepted
A, B = map(int, input().split())
print("Possible" if any((i%3==0 for i in (A, B, A+B))) else "Impossible")
# Judge status: Accepted
import numpy as np

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0] * (N-1)

for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        ans[min(d1, d2) - 1] += 1

[print(ans[i]) for i in range(N - 1)]
# Judge status: Accepted
n, a, b = map(int, input().split())
c = a + b
if n % c == 0:
    ans = a * (n // c)
elif n % c <= a:
    ans = a * (n // c) + n % c
else:
    ans = a * (n // c +1)

print(ans)
# Judge status: Accepted
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))

max_value=max(A)
max_index=A.index(max_value)
A.sort()
second_value=A[-2]

for j in range(N):
    if j==max_index:
        print(second_value)
    else:
        print(max_value)
# Judge status: Accepted
N, K, S = map(int, input().split())

t = 10 ** 9 if S < 10 ** 5 else 1
ans = [S for i in range(K)]
ans += [t for i in range(N - K)]

ans = map(str, ans)
print(" ".join(ans))
# Judge status: Accepted
## A - Divide a Cuboid
X = sorted(list(map(int, input().split())))
print(X[0] * X[1] * (X[2] - 2 * (X[2]//2) ))
# Judge status: Accepted
S = input()

print(min([abs(753 - int(S[i:i+3])) for i in range(len(S)-2)]))
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    x,y=map(int,readline().split())

    l_min=2*x
    l_max=4*x
    if l_min<=y<=l_max and y%2==0:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()
# Judge status: Accepted
h , a = map(int,input().split(" "))

if h % a == 0:
    ans = h // a
else:
    ans = h // a  + 1
print(ans)
# Judge status: Accepted
I = lambda: map(int, input().rstrip().split())
n = int(input())
if n <= 6:
  print(1)
else:
  ans = (n // 11) * 2
  if n % 11 == 0:
     pass
  elif (n // 11) % 2 == 0:
    if n % 11 <= 6:
      ans += 1
    else:
      ans += 2
  else:
    if n % 11 <= 5:
      ans += 1
    else:
      ans += 2
  print(ans)
# Judge status: Wrong Answer
x = int(input())
ans = (x // 11) * 2
if 0 < x % 11 <= 6:
    ans += 1
else:
    ans += 2
print(ans)
# Judge status: Accepted
n = int(input())

lst = []
for i in range(1, n + 1):
    s, p = input().split()
    lst.append([i, s, -int(p)])
lst.sort(key=lambda x: (x[1], x[2]))
for i in lst:
    print(i[0])
# Judge status: Accepted
# import time
N = input()
n = len(N)
# t1 = time.time()
# ぴったり払う:a 余分に払う:b
a = int(N[0])
b = 11-int(N[0])
# t2 = time.time()
for i in range(n-1):
    a1 = min(a+int(N[i+1]), b+int(N[i+1]))
    b1 = min(a+11-int(N[i+1]), b+9-int(N[i+1]))
    a = a1
    b = b1
print(min(a,b))
# t3 = time.time()

# print(t2-t1,t3-t2)
# Judge status: Accepted
n=int(input())

a = list(map(int,input().strip().split()))

su = a[0]
if n == 2:
  ar = a[1]
else:
  ar = sum(a[1:n])
dif = su-ar
mi = abs(dif)
for i in range(1,n-1):
  dif = dif+2*a[i]
  abs_dif = abs(dif)
  if mi > abs_dif:
    mi = abs_dif
print(mi)