peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x, y = map(int, input().split())
mod = 10 ** 9 +7
f = [1]

for i in range(10**6):
  f.append(f[-1] * (i+1) % mod)
  
def nCr(n, r):
  return f[n] * pow(f[r], mod-2, mod) * pow(f[n-r], mod-2, mod) % mod

if (x+y) % 3 != 0 or (x+y) // 3 < abs(x-y):
  print(0)
  exit()
  
n = (x+y)//3
r = n // 2 - abs(x-y) // 2
print(nCr(n, r))
# Judge status: Wrong Answer
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ba = [[b, a] for a, b in ab]
ba.sort(reverse=True)

f = True
for i in range(n-1):
    ba[i+1][0] = ba[i][0]-ba[i][1]
    if ba[i+1][0]-ba[i+1][1]<0:
        f = False
if f:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
X = int(input())
flag = 0
K = 0
n = 1
ans = 0


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


while flag == 0:
    K = (360 * n) / X
    if is_integer_num(K):
        flag = 1
        ans = K
    else:
        n = n + 1

print(int(ans))
# Judge status: Accepted
S = input()

a = "RRR"
b = "RR"
c = "R"
    
if a == S:
    print(3)
    
elif b in S:
    print(2)

elif c in S:
    print(1)
    
else:
    print(0)
# Judge status: Accepted
x,y = map(int,input().split())
ans = 0
mod = 10**9+7

if (x+y)%3 == 0:
    m = (2*y-x)//3
    n = (2*x-y)//3
    if m >= 0 and n >= 0:
        fac = [1]*(m+n+1)
        for i in range(2,m+n+1): 
            fac[i] = fac[i-1]*i % mod
        ans = fac[m+n]*(pow(fac[m],mod-2,mod)*pow(fac[n],mod-2,mod)%mod)%mod

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

n = int(input())

def bs(ok, ng, solve):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if solve(mid):
            ok = mid
        else:
            ng = mid
    return ok

ans = bs(n, 0, lambda x: x * 1.08 >= n)
if ans * 1.08 == n:
    print(ans)
else:
    print(':(')
# Judge status: Accepted
X = int(input())

if X==7 or X==5 or X==3:
	print('YES')
else:
	print('NO')
# Judge status: Accepted
N = str(input())
if N[0] == "9" or N[1] == "9":
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,K = map(int,input().split())
hitpoint = list(map(int,input().split()))
hitpoint.sort(reverse=True)
if N<=K:
    print(0)
else:
    print(sum(hitpoint[K:]))
# Judge status: Wrong Answer
N = int(input())
S = input()
T = input()
print(len(set(S+T)))
# Judge status: Accepted
#copy

a, b = map(int, input().split())
print(max(a + b, a + a - 1, b + b - 1))
# Judge status: Accepted
N,X,Y=map(int,input().split())
L=[0]*(N)
for i in range(N-1):
	for j in range(i,N):
		d=min(j-i,abs(X-1-i)+1+abs(Y-1-j),abs(Y-1-i)+1+abs(X-1-j))
		L[d]+=1
for i in range(1,N):
	print(L[i])
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=list(map(int,input().split()))
d=dict()
for i in range(m):
  a,b=map(int,input().split())
  if b in d:
    d[b]+=a
  else:
    d[b]=a
x=sorted(d.keys())[::-1]
now=0
for x in d:
  now+=d[x]
  l+=[x]*min(n,d[x])
  if now>n:
    break
print(sum(sorted(l)[::-1][:n]))
# Judge status: Wrong Answer
import math
a,b,x = map(int,input().split())
if 2*x>=a*a*b:
    l = 2*(b-x/a**2)
else:
    l = 2*x/a**2
print(math.degrees(math.atan(l/a)))
# Judge status: Accepted
# -*- coding: utf-8 -*-

t = input()
print(t.replace('?', 'D'))
# Judge status: Wrong Answer
A, B, C = list(map(int, input().split()))

if A == B == C:
    print(-1)
else:
    c = 0
    while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        c += 1
        A2 = (B + C) // 2
        B2 = (A + C) // 2
        C2 = (A + B) // 2

        A = A2
        B = B2
        C = C2
    print(c)
# Judge status: Wrong Answer
s, t = input().split()
a, b =map(int, input().split())
x = input()

if x == a:
  print(a - 1, b)
else:
  print(a, b - 1)
# Judge status: Accepted
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()
a = nl()
l = [0]*n
for x in a:
    l[x-1] += 1
print(*l, sep='\n')
# Judge status: Accepted
s , t = input().split()
a , b = (int(x) for x in input().split())
u = input()

if s == u:
    a -= 1
    print(a , b)
if t == u:
    b -= 1
    print(a , b)
# Judge status: Accepted
N, K =map(int,input().split())
A = list(map(int,input().split()))
ans = []
for i in range(K,N):
    if (A[i]/A[i-K])>1:
        ans.append("Yes")
    else:
        ans.append("No")

for i in range(len(ans)):
    print(ans[i])
# Judge status: Wrong Answer
def main():
    n = int(input())
    def Base_10_to_n(X, n):
        if (int(X/n)):
            return Base_10_to_n(int(X/n), n)+' '+str(X%n)
        return str(X%n)
    P = list(map(int, Base_10_to_n(n, 26).split()))
    if P[-1] == 0:
        P = P[:-1]
    ans = [0] * len(P)
    for i, p in enumerate(P):
        ans[i] = chr(96 + p)
    print(''.join(ans))


if __name__ == '__main__':
    main()
# Judge status: Accepted
S=input()
print("ABC" if S=="ARC" else "ARC")
# Judge status: Accepted
n = int(input())
print((n+1) // 2)
# Judge status: Wrong Answer
x = int(input())

distance = 0
count = 0

i = 1
while distance < x:
    distance += i
    if distance > x:
        distance -= i
        break
    count += 1
    i += 1

if x == distance:
    print(count)
else:
    print(count + x - distance)
# Judge status: Wrong Answer
n,m = map(int, input().split())
pairs = [input().split() for _ in range(n)]
pairs.sort()
count = 0
ans = 0
for i in pairs:
    ans += int(i[0])*int(i[1])
    count += int(i[1])
    if count >= m:
        ans -= int(i[0])*(count - m)
        break
print(ans)
# Judge status: Wrong Answer
INF = 10 * 18
N = int(input())
A = list(map(int, input().split()))
res = INF
t = sum(A)
s = 0
for a in A[:-1]:
    s += a
    res = min(res, abs(t - s - s))
print(res)
# Judge status: Accepted
N,K,Q=map(int,input().split())
scores=[K-Q]*N
for _ in range(Q):
    scores[int(input())-1]+=1
for score in scores:
    print('Yes' if score>0 else 'No')
# Judge status: Accepted
a,b,c=map(int,input().split())
n=a//c
m=b//c
o=0
if a%c==0:
    o=1
print(m-n+o)
# Judge status: Accepted
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,k = map(int,input().split())
ans = []
for i in range(1,101):
    if a%i == 0 and b%i == 0:
        ans.append(i)
ans.sort(reverse=True)
print(ans[k-1])
# Judge status: Accepted
n = int(input())

i = 1
while i < n:
    i = i * 2

if i > n:
    print(int(i / 2))
else:
    print(i)
# Judge status: Wrong Answer
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'DENIED'
for i in range(len(list)):
    if list[i]%2 != 0:continue
    else:
        if list[i]%3!=0 and list[i]%5!=0:
            break
        else:
            result = 'APPROVED'
print(result)
# Judge status: Wrong Answer
N = int(input())
s = input().split()
print(len(set(s)))
# Judge status: Wrong Answer
H, N = map(int, input().split())
A_list = list(map(int, input().split()))

if sum(A_list) > H:
  print("Yes")
else:
  print("No")
# Judge status: Accepted

s = input()
t = input()

if s == t[:-1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = str(input())
count = 0
for i in range(3):
    if s[i] == '1':
        count += 1
print(count)
# Judge status: Accepted
W, H, x, y = map(int, input().split())
mul = 0
if float(y) == H/2:
    if float(x) == W/2:
        mul = 1

print("{:.6f} {}".format(H*W/2, mul))
# Judge status: Wrong Answer
x,a,b = map(int, raw_input().split())
print 'delicious' if (b <= a) or (abs(b - a) < x) else 'dangerous'
# Judge status: Accepted
P, Q, R = map(int, input().split())
print((P+Q+R) - max(P, Q, R))
# Judge status: Accepted
a = input()
if(a[-1]=="s"):
    a+="es"
else:
    a+="s"
print (a)
# Judge status: Wrong Answer
s = input()
N = s.count('N')
S = s.count('S')
E = s.count('E')
W = s.count('W')
if ((N >= 1 and S == 0) or (N == 0 and S >= 1) or 
    (E >= 1 and W == 0) or (E == 0 and W >= 1)):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()
flag = 0
count = 0
for i in range(97,97+26):
    flag = 0
    for j in range(len(s)):
        if chr(i) == s[j]:
            flag = 1
            break
    if flag == 0:
        print(chr(i))
        break
    count += 1

if count == 26:
    print('None')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
res = [int()]*n
for i in range(n):
    res[i] = a[i] - i - 1
res.sort()
if n % 2 == 0:
    x = res[int(n/2)] + res[int(n/2)-1]
else:
    x = res[int(n/2)]
print(sum(res) - x * n)
# Judge status: Wrong Answer
n = int(input())

for i in range(n):
    if int(i * 1.08) == n:
        print(i)
        exit()
print(":(")
# Judge status: Accepted
a=[0]*9
a[0],a[1],a[2]=map(int, input().split())
a[3],a[4],a[5]=map(int, input().split()) 
a[6],a[7],a[8]=map(int, input().split()) 
N=int(input())
B=[]
for i in range(N):
  B.append(int(input()))
S=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
ans='No'
for lis in S:
  n=0
  if ans=="Yes":
    break
  for i in range(3):
    if a[lis[i]] in B:
      n+=1
    if n==3:
      ans="Yes"

print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())
lis=[1]
for i in range(2,1000):
    lis.append(lis[-1]+i)
i=0
while True:
    if a in lis:
        print(i)
        break
    a+=1
    i+=1
# Judge status: Accepted
A,B,T = map(int,input().split())

print(sum([B if(i%A==0) else 0 for i in range(A,T+1)]))
# Judge status: Wrong Answer
n = int(input())
s = input()
MOD = 10**9 + 7
from collections import defaultdict
cnt = defaultdict(int)
for si in s:
    cnt[si] += 1

dup = []
for ci in cnt:
    if cnt[ci] > 1:
        dup.append(cnt[ci])
#print(dup)

ans = pow(2, n, MOD) - 1
for di in dup:
    ans -= (pow(2, n-di, MOD) - 1)
print(ans)
# Judge status: Accepted
N = int(input())
S = input()

A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

T = str.maketrans(A, A[N:] + A[:N])

print(S.translate(T))
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))
cnt4 = 0
cnt2 = 0
other = 0
for a in A:
    if a % 4 == 0:
        cnt4 += 1
        continue
    if a % 2 == 0:
        cnt2 += 1
    else:
        other += 1
if cnt4+1 >= cnt2+other or (cnt2 % 2 == 0 and cnt4+1 >= other) or (cnt4 == n):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A,B=map(int,input().split())
n=1
count=0
while n<B:
    n+=(A-1)
    count+=1
print(count)
# Judge status: Accepted
h = int(input())

cnt = 1
while h // 2 > 0:
    h //= 2
    cnt += 1

print(2 ** cnt - 1)
# Judge status: Accepted
a, b, x = map(int, input().split())
print('YES' if a <= x <= (a + b) else 'NO')
# Judge status: Wrong Answer
import collections
import heapq
n = int(raw_input())
ais = map(int, raw_input().split(' ')) 
res = [None] * (n +1)
for j in range(len(ais)-1, -1, -1):
	u = j + 1
	c = u *2
	cumul = 0
	while(c <= n):
		cumul += res[c]
		c += u

	if ais[u - 1] == 1:
		if cumul % 2 == 0:
			res[u] = 1
		else:
			res[u] = 0
	elif ais[u - 1] == 0:
		if cumul % 2 == 0:
			res[u] = 0
		else:
			res[u] = 1
cc = collections.Counter(res)
print cc[1]
if cc[1]:
	print ''.join([str(i) for i in range(len(res)) if res[i]])
# Judge status: Wrong Answer
d, n = map(int, input().split())

print(100 ** d * n)
# Judge status: Wrong Answer
x,y = map(int,input().split())
if y%x == 0:
    print(-1)
else:
    print(x*y+1)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
print ("Yay!") if e-a <= k else print (":(")
# Judge status: Accepted
s = str(input())
t = str(input())
ans = []
for i in range(len(s) - len(t) + 1):
    if s[i] == t[0] or s[i] == '?':
        for j in range(len(t)):
            if not(s[i+j] == t[j] or s[i+j] == '?'):
                break
        else:
            news = s[:i] + t + s[i+len(t):]
            news = news.replace('?', 'a')
            ans.append(news)
ans.sort()
if ans:
    print(ans[0])
else:
    print('UNRESTORABLE')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
 
ans = [0]*N
for i in range(N):
  ans[A[i]-1] = str(i+1)

for i in range(N):
  print(ans[i], end=' ')
# Judge status: Accepted
s = input()
s_list = [s[_] for _ in range(len(s))]

dic = dict()
for c in s_list:
  if c in dic:
    dic[c] += 1
  else:
    dic[c] = 1

flg = True
for key in dic:
  if dic[key]%2 != 0:
    flg = False
    break
    
if flg:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N, M, X = map(int, input().split())
Book = [list(map(int, input().split())) for _ in range(N)]
List = [[0 for _ in range(M+1)] for _ in range(2**N)]
Min = float("inf")
for i in range(2**N):
  for j in range(N):
    if ((i >> j) & 1):
      for k in range(M+1):
        List[i][k] += Book[j][k]
      if Min > List[i][0] and min(List[i][1:]) >= X:
        Min = List[i][0]
if Min == float("inf"):
  print(-1)
else:
  print(Min)
# Judge status: Wrong Answer


def solution(h):
    n = len(h)
    if n == 1:
        return 0
    elif n == 2:
        return abs(h[1]-h[0])
    dp = [0]*(n)
    dp[1]  = abs(h[1]-h[0]) 
    for i in range(2,n):
        dp[i] = min( dp[i-1]+abs(h[i]-h[i-1]) , dp[i-2]+abs(h[i]-h[i-2]) )
    print(*dp)
    return dp[n-1]

N = int(input())
h = list(map(int,input().split()))
res = solution(h)
print(res)
# Judge status: Wrong Answer
N, M = map(int, input().split())
root = [set() for i in range(N + 1)]
ans = [0 for i in range(N + 1)]
for i in range(M):
    a, b = map(int, input().split())
    root[a].add(b)
    root[b].add(a)
task = [1]
itta = {1}
while len(task) > 0:
    now = task[0]
    print(now)
    additional = root[now] - itta
    for i in additional:
        ans[i] = now
        itta.add(i)
    task = task[1:] + list(additional)
print("Yes")
for i in range(2, N + 1):
    print(ans[i])
# Judge status: Accepted
a, b = map(int, input().split())

if int(a) == 1 and int(b) != 1:
    print("Alice")
elif int(a) != 1 and int(b) == 1:
    print("Bob")
elif int(a) > int(b):
    print("Alice")
elif int(a) < int(b):
    print("Bob")
elif int(a) == int(b):
    print("Draw")
# Judge status: Accepted
l = ['a', 'e', 'i', 'o', 'u']
c = input()
if (c in l) == True:
  print('vowel')
else:
  print('consonant')
# Judge status: Wrong Answer
N, M = map(int, input().split())

l = N // 2
r = l + 1

for i in range(M):
    print(l, r)
    l -= 1
    r += 1
# Judge status: Accepted
import math
A, B, N = map(int, input().split())

ans = (A*N//B) - A*(N//B)
if N >= B-1:
    ans = max(ans, (A*(B-1)//B) - A*((B-1)//B))
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=[0]+list(map(int,input().split()))
B=[0]
res=0
for n in range(1,N+1):
    a=n
    r=0
    while a<=N:
        r+=A[a]
        a+=n
    if r%2:
        res+=1
    B.append(r%2)
print(res)
print(*[i+1 for i in range(N) if B[i+1]>0],sep='\n')
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
i=N-1
ans=0
while i>=0:
  if A[i+1]>B[i]:
    ans+=B[i]
  else:
    B[i]-=A[i+1]
    ans+=A[i+1]
    ans+=min(A[i],B[i])
    A[i]-=min(A[i],B[i])
  i-=1
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a = sorted([int(i) for i in input().split()])
ans = 0
while m > 0:
    a[-1] = a[-1]//2
    num = a[-1]
    a.pop()
    m-=1
    l,r = 0,n-1
    t=0
    while l+1<r:
        t = (l+r)//2
        if a[t] < num: l=t
        elif a[t] >= num: r=t
    a.insert(t,num)  
print(sum(a))
# Judge status: Wrong Answer
N, L = map( int, input().split())

i = min( 0, ( L - 1 ) )
print( N * ( L - 1 ) + N * ( N - 1 ) // 2 - i )
# Judge status: Wrong Answer
s = int(input())
t = input()

if len(t) < s:
  print(t)
  
else :
  tt =  t[0:s]
  print(tt + "...")
# Judge status: Accepted
x = int(input())

if 7 <= x <= 11:
    print(2)
elif x <= 6:
    print(1)
else:
    a, b = divmod(x, 11)
    if b == 0:
        print(2*a)
    else:
        if b <= 6:
            print(2*a+1)
        else:
            print(2*a+2)
# Judge status: Wrong Answer
print("YNeos"["7" in input()::2])
# Judge status: Accepted
n = int(input())

a = list(map(str, input().split()))

ans = []
if n % 2 == 0:
    for i in range(n//2):
        ans.append(a[-(2*i+1)])
    for i in range(n//2):
        ans.append(a[2*i])
    print(' '.join(ans))
else:
    for i in range(n//2+1):
        ans.append(a[-(2*i+1)])
    for i in range(n//2):
        ans.append(a[2*i+1])
    print(' '.join(ans))
# Judge status: Accepted
N = input()

# NはK桁
K = len(N)

# 最上位の桁がc
c = int(N[0])

# 最上位の桁以外
d = N[1:]

if "9" * len(d) == d:
    print(c + 9 * (K - 1))
else:
    print(c + 9 * (K - 1) - 1)
# Judge status: Wrong Answer
from math import*
from bisect import*
import copy

n=int(input())
arr=list(map(int,input().split()))
arr.sort()
brr=copy.deepcopy(arr)
brr=list(set(brr))
brr.sort()
#print(arr)
ans=0
#print(bisect_right(arr,6))
for i in range(len(brr)):
	d=bisect_left(arr,brr[i])
	c=bisect_right(arr,brr[i]+2)
	if ans<c-d:
		ans=c
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
A=[]
p = [0] * M
S = [0] * M
for i in range(M):
  p[i], S[i]= map(str, input().split())
  T=[int(p[i]),S[i]]
  A.append(T)
A.sort(key=lambda x: x[0])
wa=0
ac=0
tmp=0
for j in range(M):
  if A[j][0]>tmp:
    if A[j][1]=='WA':
      wa+=1
    else:
      ac+=1
      tmp=A[j][0]
print(ac,wa)
# Judge status: Accepted
O = input()
E = input()

output = ''
if len(O) == len(E):
    for i in range(len(O)):
        output += O[i]
        output += E[i]
else :
    for i in range(len(O)):
        if i == len(O) -1:
            output += O[i]
        else :
            output += O[i]
            output += E[i]

print(output)
# Judge status: Accepted
n,m = map(int,input().split())
a = set(int(input()) for i in range(m))
mod = 1000000007
lis = []
 
if n ==  1 and m == 0:
  print(1)
  exit()
  
if 1 not in a:
  lis.append(1)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(2)
    
elif 1 in a:
  lis.append(0)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(1)
 
 
for i in range(3,n+1):
  if i in a:
    lis.append(0)
  else:
    lis.append((lis[i-2] + lis[i-3])%mod)
    
print(lis[-1])
# Judge status: Wrong Answer
N = int(input())
z = []
for _ in range(N):
  x, y = list(map(int, input().split()))
  z.append([x, y])

z.sort()
mdct = 0
lx, ly = z[0]

for x, y in z:

  mdct = max(mdct, abs(x-lx) + abs(y-ly))

print(mdct)
# Judge status: Accepted
import sys

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

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    S = in_s()

    ts = S
    while ts.count('()'):
        ts = ts.replace('()', '')

    S = '(' * ts.count(')') + S + ')' * ts.count('(')
    print(S)


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


if a + b < 24:
    print(a + b)
else:
    print(a + b - 24)
# Judge status: Wrong Answer
requestMap = list(map(int, input().split()))

D = requestMap[0]
T = requestMap[1]
S = requestMap[2]

if (S * T) >= D:
  print("YES")
else:
  print("No")
# Judge status: Accepted
n,k=map(int,input().split())
lp=list(map(int,input().split()))
lp.sort()
nlp=lp[:k]
s=0
for x in nlp:
    s += x
    
print(s)
# Judge status: Wrong Answer
N = int(input())
*D, = map(int, input().split())
MOD = 998244353

import collections
dic = collections.Counter(D)
S = sorted(set(D))

i = 0
flag = 0
ans = 1
for s in S:
    if s != i:
        flag = 1
        break
    i += 1
    if s == 0:
        continue
    ans *= pow(dic[s-1], dic[s], MOD)
    ans %= MOD

if flag:
    print(0)
else:
    print(ans)
# Judge status: Accepted
x, a, b = map(int, input().split())
if (b-a) <= 0:
    print('delicious')
elif (b-a) <= x:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
x,y = map(int,input().split())
if x==1 and ( y==2 or y==4):
  print("Yes")
else:
  if y%2==1:
    print("No")
  else:
    if y<=x*4 and (y>=(x*2)):
      print("Yes")
    else:
      print("No")
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,input().split()))
p.sort(reverse=True)
count=0
for i in range(len(p)):
    for j in reversed(range(i+1,len(p))):
        if p[i]%p[j] ==0:
            break
        if j == i+1:
            count +=1
if count >=1:
    print(count+1)
else:
    print(count)
# Judge status: Wrong Answer
N = int(input())
if N < 1000:
  print("ABC"+ str(N))
else:
  print("ABD" + str(N))
# Judge status: Wrong Answer
num = input()

print(1 if num==0 else 0)
# Judge status: Accepted
from collections import deque
x = input()
n = len(x)
st = deque()

for i in range(n):
    if x[i] == "S":
        st.append("S")
    else:
        if st == deque([]):
            st.append("T")
        else:
            a = st.pop()
            if a == "T":
                st.append("T")
                st.append("T")
            else:
                continue
                
print(len(st))
# Judge status: Wrong Answer
a,b = map(int, input().split())
print(str((a+b)%24)+":00")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

ame_A = [0] * N
ame_B = [0] * N

for i in range(N):
  if i == 0:
    ame_A[i] += A[i]
    continue
  ame_A[i] += ame_A[i-1] + A[i]

for i in range(N-1,-1,-1):
  if i == N - 1:
    ame_B[i] += B[i]
    continue
  ame_B[i] += ame_B[i+1] + B[i]
  
ans = 0
for j in range(N):
  cnt = ame_A[j] + ame_B[j]
  ans = max(ans, cnt)
  
print(ans)
# Judge status: Accepted
k,n,*l=map(int,open(0).read().split());print(min((l[i-1]-l[i])%k for i in range(n)))
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!s = input()
n, m = map(int, input().split())
x = []
y = []
for i in range(m):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)
boxes = [False]*n
boxes[0] = True
boxescnt = [1]*n
for i in range(m):
    if boxes[x[i]-1] == True:
        if boxescnt[x[i]-1] == 1:
            boxes[x[i]-1] = False
        boxes[y[i]-1] = True
        boxescnt[x[i]-1] -= 1
        boxescnt[y[i]-1] += 1
print(sum(boxes))
# Judge status: Wrong Answer
a = str(input())
b = str(input())

if a < b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
S = int(input())
print('0 0 1 0 0', S)
# Judge status: Wrong Answer
N, X, Y = input().split()
N = int(N)
X = int(X)
x = X - 1
Y = int(Y)
y = Y -1
ans = [0] * (N-1)
A = [[0] * N for _ in range(N)]
for i in range(N):
    for j in range(N-i):
        path = min(abs(x- i) +1 +abs(y-i-j),j)
        ans[path] += 1
for _ in ans:
    if _ ==0:
        continue
    print(_)
# Judge status: Accepted
from math import *
from collections import *
from random import *
from decimal import Decimal
from bisect import *
import sys
input=sys.stdin.readline
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
def inp():
    return int(input())

n,k=ma()
a=lis()
l,h=0,max(a)
while(l+1<h):
    m=(l+h)//2
    c=0
    for i in a:
        c+=ceil(i/m)-1
    if(c<=k):
        h=m
    else:
        l=m
print(h)
# Judge status: Accepted
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)
# Judge status: Accepted
a, b, c = map(int, input().split())
if c < a + b:
    print('No')
elif 4 * a * b < pow(c - a - b,2):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N=int(input())
P=list(map(int,input().split()))
c=0
m=max(P)
for i in range(N):
  m=min(m,P[i])
  if P[i]==m:
    c+=1
    
print(c)
# Judge status: Accepted
from collections import deque
S=list(input())
Q=int(input())
ls=[list(input().split()) for _ in range(Q)]
D=deque()
for i in range(len(S)):
  D.append(S[i])  
a=1
for i in range(Q):
  if ls[i][0]=="1":
    a*=(-1)
  else:
    if (ls[i][1]=="1" and a==1) or (ls[i][1]=="2" and a==-1):
      D.appendleft(ls[i][2])
    else:
      D.append(ls[i][2])
if a==1:
  while D:
    print(D.popleft(), end="")
else:    
  while D:
    print(D.pop(), end="")