peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1,N):
    a = gcd(ans,T[i])
    ans = (ans//a)*T[i]
print(ans)
# Judge status: Accepted


def solve():
    N = int(input()[-1])
    if N in [2,4,5,7,9]:
        print('hon')
    elif N in [0,1,6,8]:
        print('pon')
    elif N in [3]:
        print('bon')


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
x, y = map(int, input().split())
if x*y < 0: print(abs(abs(x)-abs(y))+1)
elif x <= y: print(y-x)
else: print(x-y+2)
# Judge status: Accepted
N, K = map(int, input().split())
L = [0] * N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in A:
        L[j-1] += 1
print(len([i for i in L if i == 0]))
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
a2=sorted(a)
kindnum=[]
kind=1
now=a2[0]
ren=1
for i in range(1,n):
    if now!=a2[i]:
        kindnum.append(ren)
        kind+=1
        now=a2[i]
        ren=1
        continue
    ren+=1
kindnum.append(ren)
kindnum2=sorted(kindnum)
if kind<=k:
    print(0)
else:
    ans=0
    for i in range(kind-k):
        ans+=kindnum2[i]
    print(ans)
# Judge status: Accepted
N = input()
L = len(N)
ans = 0
t = 0
for i in range(L-1,-1,-1):
    n = int(N[i])+t
    if n == 5:
        if i > 0 and int(N[i-1]) >= 5:
            ans += 10-n
            t = 1
            continue
    if n <= 5:
        ans += n
        t = 0
    else:
        t = 1
        ans += 10-n
if t==1:
    ans += 1
print(ans)
# Judge status: Wrong Answer
x=[int(input()) for _ in range(6)]
print('Yay!' if bool((x[k]-x[i]<=x[5]) for i in range(5) for k in range(i+1, 5)) else ':(')
# Judge status: Accepted
import math
A, B = map(int, input().split())
b1 = B*10
b2 = b1 + 10

for i in range(b1, b2):
    if math.floor(i*0.08) == A:
        print(i)
        break

    if i == b2-1:
        print(-1)
# Judge status: Accepted
a = int(input())
print(10-int(a/200))
# Judge status: Accepted
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    H = list(map(int, input().split()))

    ans = 0
    count = 0

    now = H[0]
    for i in range(1, N):
        if H[i] <= now:
            count += 1
        else:
            ans = max(ans, count)
            count = 0
        now = H[i]
    else:
        ans = max(ans, count)

    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
n,m,x = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
b = [sum(j[1:])/a[k][0] for k,j in enumerate(a)]
c = sorted(b,reverse=True)
l = [0]*m
p = 0
for i in c:
    if all([i>=x for i in l]):
        break
    f = a[b.index(i)]
    p+=f[0]
    for k,j in enumerate(f[1:]):
        l[k]+=j
if all([i>=x for i in l]):
    print(p)
else:
    print(-1)
# Judge status: Accepted
S = input()
n = [0] * 3
d = {'a':0, 'b':1, 'c':2}
for s in S:
    n[d[s]] += 1


if max(n) - min(n) > 1:
    print('NO')
else:
    print('YES')
# Judge status: Wrong Answer
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())))[a-x:]
q = sorted(list(map(int, input().split())))[a-y:]
r = sorted(list(map(int, input().split()))+p+q)[::-1]

print(sum(r[:x+y]))
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))

if 2 in a:
    two_cnt=1
else:
    two_cnt=0

other_cnt=len([i for i in a if i % 2 != 0])
four_cnt=len([i for i in a if i % 4 == 0])

if four_cnt+1>=two_cnt+other_cnt:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
h, n = map(int,input().split())
a = list(map(int, input().split()))

if sum(a) >= h:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b=map(int, input().split())
if a>b:
  print(a-1)
else:
  print(a)
# Judge status: Accepted
import sys
input = sys.stdin.readline

A,B = list(map(int,input().split()))
A = (A-2)%13
B = (B-2)%13
print('Alice' if A>B else 'Bob' if B>A else 'Draw')
# Judge status: Accepted
from collections import Counter

N = int(input())

A = [str(i) for i in range(1, N + 1)]

C = Counter()
for s in A:
    C[s[0] + s[-1]] += 1

ans = 0
for s in A:
    if s[0] != '0' and s[-1] != '0':
        ans += C[s[-1] + s[0]]

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

ans = 0

A = [0] * N
A[0] = B[0]
A[-1] = B[-1]

for i in range(1, N-1):
    min_B = min(B[i-1], B[i])
    A[i] = min_B

print(sum(A))
# Judge status: Accepted
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    mul4 = len([a for a in A if a % 4 == 0])
    mul2 = len([a for a in A if a % 4 != 0 and a % 2 == 0])
    less = N - 2*mul4 - 1
    if less <= 0:
        print("Yes")
    elif less + 1 <= mul2:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
A, B = map(int,input().split())
if A <=8 and B <=8:
  print('Yay')
else:
  print(':(')
# Judge status: Accepted
s = input()
acgt = ['A','C','G','T']
ans = 0
p = 0
for i in range(len(s)):
    if s[i] in acgt:
        p += 1
    else:
        ans = max(ans,p)
        p = 0
print(max(ans,p))
# Judge status: Wrong Answer
R=int(input())
a=float(R*3.141516)
print(a)
# Judge status: Accepted
# import bisect
# from collections import Counter, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    s = input()
    zero = s.count("0")
    one = s.count("1")
    print(2 * min(zero, one))

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline
from collections import deque
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(m)]
graph = [[] for i in range(n+1)]
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
q = deque()
q.append(1)
ans = [0 for i in range(n+1)]
ans[1] = -1
while q:
  x = q.popleft()
  for y in graph[x]:
    if ans[y] == 0:
      ans[y] = x
      q.append(y)
print("Yes")
print(*ans[2:],sep="\n")
# Judge status: Accepted
n = input()
d = [0 for _ in range(9)]
seq = [int(x) for x in input().split()]
for val in seq:
    val = min(val, 3300)
    d[(val // 400)] += 1
a = sum(1 for val in d[:-1] if val > 0)
print(max(1,a), a + d[-1])
# Judge status: Accepted
n,m = map(int, input().split())
abl = []
cdl = []
for _ in range(n):
    a,b = map(int, input().split())
    abl.append((a,b))

for _ in range(m):
    c,d = map(int, input().split())
    cdl.append((c,d))


for a,b in abl:
    cmin = 10**10
    mini = -1
    for i,(c,d) in enumerate(cdl):
        v = abs(a-c)+abs(b-d)
        if v < cmin:
            cmin = v
            minc,mind = c,d
            mini = i+1
    print(mini)
# Judge status: Accepted
n = int(input())
a_list = [int(input()) for _ in range(n)]

cnt = 0
for i in range(n-1):
    cnt += a_list[i] // 2
    a_list[i] = a_list[i] % 2

    if a_list[i] == 1 and a_list[i+1] >= 1:
        cnt += 1
        a_list[i] = 0
        a_list[i+1] -= 1

# 最後に末尾のやつを処理する
cnt += a_list[n-1] // 2

print(cnt)
# Judge status: Wrong Answer
import queue
k = int(input())
q = queue.Queue()

for i in range(1,10):
    q.put(i)

for i in range(k):
    x = q.get()

    p = 10 * x  
    m = x % 10
    if not p == 0:
        q.put(p + m - 1)

    q.put(p + m)

    if not p == 9:
        q.put(p + m + 1)
    
print(x)
# Judge status: Accepted
S=list(map(int,list(input())))
print(2*min(sum(S),len(S)-sum(S)))
# Judge status: Accepted
n = int(input())
s = input()
t = input() + 'x'

for i in range(n):
    if s[i:]==t[:~i]:
        print(n+i)
        exit()

print(2*n)
# Judge status: Accepted
x = int(input())
now = 100
for i in range(1,100000):
  now *= 1.01
  now //= 1
  if now >= x:
    print(i)
    break
# Judge status: Accepted
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a=(a[1]-a[0],a[2]-a[0])
b=(b[1]-b[0],b[2]-b[0])
c=(c[1]-c[0],c[2]-c[0])
if a==b and b==c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split())) + [0]
ans = 0
maxh = a[0] 
for i in range(n):
    if maxh > a[i]:
        ans += maxh - a[i]
        a[i] = maxh
    else:
        maxh = a[i]
print(ans)
# Judge status: Accepted
n, a, b = list(map(int, input().split()))

s = str(input())

count_a = 0
count_b = 0

for i in s:
  
  j = ""
  
  if count_a+count_b >= (a+b):
    j = "No"
  
  elif i == "a":
    count_a += 1
    j = "Yes"
    
  elif i=="b":
    j = "Yes"
    
    if count_b >= b:
      j = "No"
    
    else:
      count_b += 1
      
  else:
    j = "No"
    
  print(j)
# Judge status: Accepted
from functools import reduce


def lcm(a, b):
    ab = a * b
    while b != 0:
        a, b = b, a % b
    return ab // a


def solve(string):
    n, m, *a = map(int, string.split())
    c = 2**len(bin(a[0]).split("1")[-1])
    l = reduce(lcm, (2 * m + 2 if _a % c or not _a // c % 2 else _a for _a in a))
    return str(max((m - l // 2) // l + 1, 0))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
# Judge status: Wrong Answer
k=int(input())
a=0
if k%2==0:
  print(-1)
else:
  for i in range(k):
    a=(a*10+7)%k
    if a==0:
      print(i+1)
      exit()
# Judge status: Accepted
def main():
    from itertools import accumulate
    n, *ab = map(int, open(0).read().split())
    c = list(zip(*[iter(ab)] * 2))
    c.sort(key=lambda x: (x[1], x[0]))
    d, f = zip(*c)
    for i, j in zip(accumulate(d), f):
        if i > j:
            print('No')
            break
    else:
        print('Yes')


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())

ans = a*x + b*y
ans = min(ans, 2*c*max(x, y))
if x < y:
    ans = min(ans, c*2*x + b*(y-x))
else:
    ans = min(ans, c*2*y + a*(x-y))
print(ans)
# Judge status: Accepted
nums = list(map(int, input().split()))

for i in range(len(nums)):
    if nums[i] == 0:
        print(i+1)
# Judge status: Accepted
A = []

for _ in range(3):
  for e in list(map(int, input().split())):
    A.append(e)

N = int(input())

for _ in range(N):
  n = int(input())
  if n in A:
    A[A.index(n)] = 0

patterns = [
  [0, 1, 2],
  [3, 4, 5],
  [6, 7, 8],
  [0, 3, 6],
  [1, 4, 7],
  [2, 5, 8],
  [0, 4, 8],
  [2, 4, 6]
]

for pattern in patterns:
  if not any([A[e] for e in pattern]):
    print('Yes')
    exit()

print('No')
# Judge status: Wrong Answer
s = input()

n = list(set((s)))
print(n)

if n == ["h", "i"] or ["i", "h"]:
    print("Yes")

else:
    print("No")
# Judge status: Accepted
h, n = map(int, input().split())
a, b = [0] * n, [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

dp = [(-(-i // a[0]) * b[0]) for i in range(h + 1)]
for i in range(1, n):
    for j in range(1, h + 1):
        dp[j] = min(dp[j], dp[max(j-a[i],0)] + b[i])

print(dp[-1])
# Judge status: Accepted
s = input(); n = len(s)
dp = [ [0,1<<32] for i in range(n+1) ]
for i in range(n):
  d = ord(s[i])-ord('0')
  dp[i+1][0] = min(dp[i][0], dp[i][1])+d
  dp[i+1][1] = min(dp[i][0], dp[i][1]-2)+11-d
print(min(dp[n][0],dp[n][1]))
# Judge status: Accepted
N,K=map(int,input().split())
if N%K==0:
    print("0")
else:
    print("1")
# Judge status: Accepted
X = list(map(int, input().split()))
X.sort()
ba = X[1] - X[0]
ca = X[2] - X[0]
cb = X[2] - X[1]
if ba % 2 == 0 and ca % 2 == 0:
    print((ca + cb) // 2)
elif ba % 2 == 0:
    print(1 + (ca - 1 + cb - 1) // 2)
else:
    print((cb + ca + 1) // 2 + 1)
# Judge status: Accepted
N, M = map(int, input().split())
if N == 1 and M == 1:
    print(1)
elif (N == 1 and M >= 2) or (M == 1 and N > -2):
    print(max(N, M) - 2)
else:
    print((N - 2) * (M - 2))
# Judge status: Accepted
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]


ans = False
for a in A:
    ans |= set(a) <= set(B)
    
for i in range(3):
    ans |= set([A[0][i], A[1][i], A[2][i]]) <= set(B)
    
ans |= set([A[0][0], A[1][1], A[2][2]]) <= set(B)
ans |= set([A[0][2], A[1][1], A[2][0]]) <= set(B)
    
print("Yes" if ans else "No")
# Judge status: Accepted
S = input()
A = 'Yes'
for i in range(len(S)):
    if i%2==0 and S[i] == 'L':
        A = 'No'
    elif i%2 == 1 and S[i] == 'R':
        A = 'No'
print(A)
# Judge status: Wrong Answer
n ,x, y = map(int, input().split())
ans=[0 for i in range(n-1)]

def check(i, j):
    
    a = j-i
    
    short = abs(x-i) + 1 + abs(j-y)
    if a==short:
        ans[a-1] += 2
    else:
        mini = min(a, short)
        ans[mini-1] += 1
        
for i in range(1, n):
    for j in range(i+1, n+1):
        check(i,j)


print(*ans, sep='\n')
# Judge status: Accepted
D=int(input())
if(D==25):
    print("Christmas")
elif(D==24):
    print("Christmas Eve")
elif(D==23):
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
# Judge status: Wrong Answer
from math import log2

def main():
    N = int(input())
    if N == 0:
        print(0)
        return
    Ans = []
    while N !=  1:
        r = N%2
        Ans.append(r)
        N = -1*( N // 2)
    print(*Ans[::-1],sep="")
    return

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)

# 座標圧縮
# 座圧

N, M = map(int, input().split())
PY = [[int(x) for x in input().split()] for _ in range(M)]

PREFECTURE = defaultdict(list)
for p, y in PY:
    PREFECTURE[p].append(y)

print(PREFECTURE)

for i in PREFECTURE.keys():
    ys = sorted(PREFECTURE[i])
    y_to_i = {y: i+1 for i, y in enumerate(ys)}
    PREFECTURE[i] = y_to_i

for p, y in PY:
    print('{:06}{:06}'.format(p, PREFECTURE[p][y]))
# Judge status: Accepted
n=int(input())
ans=0
for i in range(n):
    if (i+1)%3==0 and (i+1)%5==0:
        continue
    elif (i+1)%3==0:
        continue
    elif (i+1)%5==0:
        continue
    else:
        ans+=i+1
print(ans)
# Judge status: Accepted
N=int(input())
A,B=[],[]
for i in range(N):
  x,y=map(int, input().split())
  A.append(x+y)
  B.append(x-y)
  
A=sorted(A)
B=sorted(B)
print(max(abs(A[0]-A[-1]),abs(B[0]-B[-1])))
# Judge status: Wrong Answer
x,y,z = map(int,input().split())
s = 0
count = 0

for i in range(10**99):
  s += y+z
  count += 1
  if s > x:
    break
  
if s - z <= x:
  print(count)
else:
  print(count-1)
# Judge status: Accepted
def main():
    A = [int(i) for i in input().split()]
    A.sort()
    B = [A[2] - A[0], A[2] - A[1]]
    ans = 0
    if B[0] % 2 == B[1] % 2:
        ans = (B[0]+B[1])//2
    else:
        ans = 0--(B[0]+B[1])//2 + 1
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
S=list(input())
k=int(input())

if S[0]=='1':
  if k==1:
    print(S[0])  
  elif k<(10**14+1):
    print(S[2])
  else:
    print(S[1])

elif S[0]=='2':
  if k<(10**14+1):
    print(S[0])
  else:
    if S[1]!=1:
      print(S[1])
    else:
      print(S[2])#1が続く場合は次の1以外の数字
      
else:
  print(S[0])
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    ans = [0]*(M+1)
    for _ in range(N):
        food = list(map(int, input().split()))
        K = food[0]
        for i in range(1, K + 1):
            ans[food[i]] += 1
    print(ans.count(N))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
f = sys.stdin
n = int(f.readline())
a = list(map(int, f.readline().split()))
a.sort()
ans = a[0]
for i in range(n-1):
    if a[i] == a[i+1]:
        continue
    
    if a[i]%2 == 0:
        ans = 2
        continue
    
    if a[i]%2 == 1:
        ans = 1
        break
print(ans)
# Judge status: Accepted
mod = 10 ** 9 + 7

def fact(n,k,mod):
    res = 1
    for i in range(k):
        res = res * (n-i) % mod
    return res % mod

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

ans = pow(2,n,mod) - 1

ans = (ans - fact(n,a,mod)*pow(fact(a,a,mod),mod-2,mod)) % mod
ans = (ans - fact(n,b,mod)*pow(fact(b,b,mod),mod-2,mod)) % mod

print(ans)
# Judge status: Wrong Answer
S = input()
T = input()
def match(s,t):
    for c,d in zip(s,t):
        if c == "?":
            continue
        elif c == d:
            continue
        else:
            return False
    return True
for i in range(len(S)):
    s = S[i:i+len(T)]
    if match(s, T):
        print((S[:i]+T+S[i+len(T):]).replace("?","a"))
        exit(0)
print("UNRESTORABLE")
# Judge status: Accepted
s, w = map(int, input().split())
print("unsafe" if s <= w else "safe")
# Judge status: Accepted
n, m = map(int, input().split())
hs = list(map(int, input().split()))

peaks = [True] * n

for i in range(m):
  a, b = map(int, input().split())
  if hs[a - 1] > hs[b - 1]:
    peaks[b - 1] = False
  elif hs[a - 1] < hs[b - 1]:
    peaks[a - 1] = False
  else:
    peaks[a - 1] = False
    peaks[b - 1] = False

print(peaks.count(True))
# Judge status: Accepted
def main():
    a, b = map(int, input().split())

    if a == 0 or b == 0:
        print("Zero")
    
    elif a < 0 and b > 0:
        print("Zero")

    elif a < 0 and b < 0:
        if abs(b - a + 1) % 2 == 1:
            print("Negative")
        else:
            print("Positive")

    elif a > 0 and b > 0:
        print("Positive")

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
#!/usr/bin/env python3
import math

n, k = map(int, input().split())
print(math.ceil(math.log2(n)/math.log2(k)))
# Judge status: Accepted
n=int(input())
def d(s):
  if len(s)==n:print(s)
  else:
    for i in range(97,ord(max(s))+2):d(s+chr(i))
d("a")
# Judge status: Wrong Answer
##175
##A - Rainy Season
S = str(input())
if "R" in S:
    if S[1] == "S":
        print(1)
    else:
        if S[0] == "R" and S[2] == "R":
            print(3)
        else:
            print(2)
    
else:
    print(0)
# Judge status: Accepted
N = int(input())
S = list(input())
 
f = 0
b = 0
count = 0
for i in range(N - 1, -1, -1):
    if S[i] == '(':
        if count > 0:
            count -= 1
        else:
            b += 1
    else:
        count += 1
 
print('(' * count, end='')
print(*S, sep='', end='')
print(')' * b)
# Judge status: Accepted
import numpy as np

n, x = [int(_) for _ in input().split()]
l = np.cumsum(np.array([int(_) for _ in input().split()]))
print(sum([i <= x for i in l])+1)
# Judge status: Wrong Answer
S = input()
Q = [input().strip() for i in range(int(input()))]

r_flg = False
for query in Q:
  if query == "1":
    r_flg = not r_flg
  else:
    _, f, c = query.split()
    f_flg = (f == "1")
    end = (r_flg ^ f_flg)
    if end:
      S = S + c
    else:
      S = c + S

if not r_flg:
  S = S[::-1]
  
print(S)
# Judge status: Wrong Answer
from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
if n<=k:
    print(0)
else:    
    c = Counter(a)
    l = sorted(list(c.values()))
    print(sum(l[:k-1]))
# Judge status: Accepted
n,*l=map(int,open(0).read().split())
e=[1]
for i in range(n):
  e+=[(e[-1]-l[i])*2]
a=t=0
for i in range(n,-1,-1):
  if l[i]>e[i]:
    print(-1)
    break
  t=min(l[i]+t,e[i])
  a+=t
else:
  print(a)
# Judge status: Accepted
N = int(input())
A = [int(i) - 1 for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

ans = 0
prev = -10
for a in A:
    if a == prev + 1:
        ans += C[prev]
    ans += B[a]
    prev = a

print(ans)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
a = list(int(input()) for i in range(n))

ans = 0

for i in range(n):
    ans += a[i]//2

i=0
while i < n-2:
    if a[i] %2==1 and a[i+1]%2==0 and a[i+2]%2==1:
        ans+=1
        i+=2
    i+=1

print(ans)
# Judge status: Accepted
from sys import exit

n=int(input())

while n>0:
	if n%7==0:
		print("Yes")
		exit()
	n-=4
	if n==0:
		print("Yes")
		exit()

print("No")
# Judge status: Accepted
if __name__ == "__main__":
    n = int(input())
    s = input()

    if n == 2:
        if s[0] == s[1]:
            print(1)
            exit()
        else:
            print(0)
            exit()

    ans = 0
    for i in range(1, n):
        front = set(s[0:i])
        back = set(s[i:n])

        tmp = len(front.intersection(back))
        if ans < tmp:
            ans = tmp

    print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if a + b * 2 >= c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline


def read():
    N, M = map(int, input().strip().split())
    return N, M


def solve(N, M):
    nScc = min(N, M//2)
    N -= nScc
    M -= nScc * 2
    if M >= 4:
        nScc += M // 4
    return nScc


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
# Judge status: Accepted
N, K = map(int,input().split())
C = list(map(int,input().split()))

K -= 1
D = 10**9
for i in range(N-K):
    d = C[i+K] - C[i]
    L = d + abs(0 - C[i])
    R = d + abs(0 - C[i+K])
    D = min(D,min(L,R))

print(D)
# Judge status: Accepted
a,b,c = map(int, input().split())
print("Yes" if a+b >= c else "No")
# Judge status: Wrong Answer
N = int(input())
S = input()
ans = 0
for i in range(N):
  if S[i] == "I":
    ans += 1
  else:
    ans -= 1
print(ans)
# Judge status: Wrong Answer

n=input()

k=len(n)
if k>=5:
    print(9+900+int(n)-10000)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100+1)
elif k==2:
    print(9)
else:
    print(int(n)+1)
# Judge status: Wrong Answer
N = int(input())
plist = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
    if plist[i] == i + 1 or plist[i + 1] == i + 2:
        plist[i], plist[i + 1] = plist[i + 1], plist[i]
        ans += 1
if plist[-1] == N:
    ans += 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
x_l = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    x_l.append(array)

x_l.sort()
if N<3:
  for i in range(1,N):
    if (x_l[i-1][0] + x_l[i-1][1]) > (x_l[i][0] - x_l[i][1]):
      del x_l[i]
    print(len(x_l))
#else:
#  for i in range(1,N-1):
#    if (x_l[i-1][0] + x_l[i-1][1]) > (x_l[i][0] - x_l[i][1]):
#      del x_l[i]

#  print(len(x_l))
# Judge status: Wrong Answer
s = input()

if s[:2] == "00" or s[2:] == "00":
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
x=0
for i in range(n):
    if(l[i]%4==0):
        x+=1
if(n%2==0):
    if(x==n//2):
        print("Yes")
    else:
        print('No')
else:
    if(x==n//2 or x==(n-n//2)):
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n = int(input())
ans = 0
x = 0
for i in range(n):
    a = int(input())
    ans += (a + x) // 2
    x = (a + x) % 2 if a != 0 else 0
    #print(a, x, ans)
print(ans)
# Judge status: Accepted
n = int(input())
blue_cards = {}
for i in range(n):
    s = input()
    if s in blue_cards:
        blue_cards[s] += 1
    else:
        blue_cards[s] = 1

m = int(input())
red_cards = {}
for i in range(m):
    s = input()
    if s in red_cards:
        red_cards[s] += 1
    else:
        red_cards[s] = 1
        
ans = 0
for k in blue_cards:
    if k in red_cards:
        score = blue_cards[k] - red_cards[k]
    else:
        score = blue_cards[k]
    ans = max(ans, score)
print(ans)
# Judge status: Accepted
import numpy as np 
A=[]
A.extend(list(map(int,input().split())))
A.extend(list(map(int,input().split())))
A.extend(list(map(int,input().split())))
N = int(input())
check = [False]*9
for i in range(N):
    b=int(input())
    if(b in A):
        check[A.index(b)]=True
posi_list=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
np_check=np.array(check)
for i in range(len(posi_list)):
    if (False not in np_check[posi_list[i]]):
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
from collections import Counter
s=input()[::-1]
for i in range(1,len(s)):
  if all([True if i%2==0 else False for i in Counter(s[i:]).values()]):
    print(len(s[i:]))
    break
else:
  print(2)