peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
s = input()
lis = s.split()
a = int(lis[0])
b = int(lis[1])
c = int(lis[2])
if c - a - b < 0:
    print("No")
else:
    ee = (c - a - b) * (c - a - b)
    dd = 4 * a * b - ee
    if dd < 0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n=int(input())

a=[[int(i) for i in input().split()] for j in range(2)]

sentou=[]
usiro=[]

for i in range(n):
    if i==0:
        sentou.append(a[0][0])
        usiro.append(a[1][-1])
    else:
        sentou.append(a[0][i]+sentou[-1])
        usiro.append(a[1][-i-1]+usiro[-1])

usiro=usiro[::-1]
ans=[]
for i in range(n):
    ans.append(sentou[i]+usiro[i])
print(max(ans))
# Judge status: Accepted
def main():
    a, b = map(int, input().split())

    if a < 6:
        print(0)
    elif a < 13:
        print(int(b/2))
    else:
        print(b)
    



if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
A, B = map(int, input().strip().split())
if A == B:
    print("Draw")
elif A == 1:
    print("Alice")
elif B == 1:
    print("Bod")
elif A > B:
    print("Alice")
else:
    print("Bob")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a_sum, b_sum = sum(A), sum(B)
turns = b_sum - a_sum
a_small = 0
b_small = 0
for a, b in zip(A,B):
    if a < b:
        a_small += (b - a + 1) // 2
    else:
        b_small += a - b
if a_small <= turns and b_small <= turns:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = input()

ans = ""
for i in range(len(s)):      
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    else:
        ans = ans[:-1]
print(ans)
# Judge status: Accepted
D = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7-D.index(input()))
# Judge status: Accepted
s = input()
t = input()

n = len(s)
m = len(t)

for i in range(n-m, -1, -1):
  x = s[i:i+m]
  for j in range(m+1):
    if j == m:
      print((s[:i]+t+s[i+m:]).replace("?","a"))
      exit()
    if x[j] == "?": continue
    elif x[j] != t[j]: break
    
print("UNRESTORABLE")
# Judge status: Accepted
W, H, x, y = map(int, input().split())

ans = 0
if ((W/2)==x) & ((H/2)==y):
    ans = 1

print(W*H/2, ans)
# Judge status: Accepted
a,b,c=1,0,0
exec('a,b,c=b,c,(a+c)%(10**9+7);'*(int(input())-2))
print(c)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()
flag = [False for i in range(n)]
score = {"r":p, "s":r, "p":s}
ans = 0
for i in range(n):
    if i >= k:
        if t[i] == t[i-k]:
            if flag[i-k] == True:
                ans += score[t[i]]
            else:
                flag[i] = True
        else:
            ans += score[t[i]]
    else:
        ans += score[t[i]]
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
A=list(map(int,input().split()))
cnt=0
s=1
M=[0]
B=[0]*(n+1)
while cnt<n:
    s=A[s-1]
    if B[s-1]==0:
        B[s-1]+=1
    else:
        imp=s-1
        break
    M.append(s-1)
    cnt+=1
x=M.index(imp)
y=len(M)-x

if k<=x:
    print(M[k]+1)
else:
    N=M[x:]
    print(N[(k-x)%y]+1)
# Judge status: Accepted
digits = "abcdefghijklmnopqrstuvwxyz"

n = int(input())
ans = []

while n:
    n -= 1
    m = n%26
    n = n//26
    ans.append(digits[m])

print("".join(ans)[::-1])
# Judge status: Wrong Answer
N,X,Y = list(map(int,input().split()))

from collections import defaultdict
graph = defaultdict(set)

for i in range(N-1):
  graph[i] |= {i+1}
  graph[i+1] |= {i}

graph[X-1] |= {Y-1}
graph[Y-1] |= {X-1}
MAP = [[ N for j in range(N)] for i in range(N)]
for i in range(N):
  MAP[i][i] = 0
for fr in range(N):
  for to in range(N):
    MAP[fr][to] = min(
      [MAP[fr][i]+1 for i in graph[to]]
    )
res = []
for i in MAP:
  for j in i:
    res.append(j)
from collections import Counter
c = Counter(res)
for i in range(2,N+1):
  print(c[i])
# Judge status: Wrong Answer
N = int(input())

def to_n(X, n):
    if (int(X / n)):  return to_n(int(X / n), n) + str(X % n)
    return str(X % n)

ans = 10 ** 9 + 7
for i in range(N):
    N6 = to_n(N - i, 6)
    N9 = to_n(i, 9)
    res = 0
    for j in N6:  res += int(j)
    for j in N9:  res += int(j)
    ans = min(res, ans)
print(ans)
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,s = inpl()
res = 0
for i in range(n+1):
    for j in range(n+1):
        if 0 <= s - (i+j) <= n:
            res += 1
print(res)
# Judge status: Accepted
import collections
n,k = map(int,input().split())
a = list(map(int,input().split()))
c = collections.Counter(a)
values, counts = zip(*c.most_common())
print(sum(counts[k:]))
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n=ii()

if n%2 == 0:
    print(1/2)
else:
    print((n+1)//2/n)
# Judge status: Accepted
N = int(input())
l = [(i,j) for i,j in enumerate(map(int, input().split()), start=1)]
print(*[i for i, j in sorted(l, key=lambda x:x[1])])
# Judge status: Accepted
a, b, c = map(int, input().split())
if c - a - b > 0 and 4 * a * b < (c - a - b) ** 2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# coding: utf-8

N = int(input())
A = []
for _ in range(2):
    A.append(list(map(int, input().split(" "))))


def oritara(A, orirutoko):
    tmp = sum(A[0][:orirutoko+1])
    tmp += sum(A[1][orirutoko:])
    return tmp

ame = 0
for i in range(N):
    ame = max(oritara(A, i), ame)

print(ame)
# Judge status: Wrong Answer
import bisect

n = int(input())
A = []
count = 0
for _ in range(n):
    a = int(input())
    if len(A) == 0:
        A.append(a)
        count += 1
        continue
    i = bisect.bisect_right(A, a)
    if i == 0:
        A.insert(0, a)
        count += 1
    else:
        bisect.insort_right(A, a)
        if A[i-1] != A[i]:
            del A[i-1]
        else:
            count += 1

ans = count
print(ans)
# Judge status: Accepted
import math
N = int(input())
print(math.floor(N**0.5)**2)
# Judge status: Accepted
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

N = int(input())
A = lint()
S = set()
pro = 0
for a in A:
    if a//400<8:
        S.add(a//400)
    else:
        pro += 1
print(max(1,len(S)),len(S)+pro)
# Judge status: Accepted
s, w = map(int, input().split())

if w >= s:
  print("unsafe")
else:
  print("safe")
# Judge status: Accepted
import sys
input = sys.stdin.readline
import heapq

n,m = map(int,input().split())
l = list(map(int,input().split()))
s = sum(l)
for i in range(n):
    l[i] *= (-1)

heapq.heapify(l)

discount = 0

for i in range(m):
    x = (-heapq.heappop(l))
    heapq.heappush(l,-(x//2))
    discount += (x-x//2)

print(s-discount)
# Judge status: Accepted
from itertools import combinations

n = int(input())
l = sorted(map(int, input().split()))
c = 0
for i, j, k in combinations(range(n), 3):
    li, lj, lk = l[i], l[j], l[k]
    if li == lj or lj == lk or lk == li:
        continue
    if li + lj > lk:
        c += 1
print(c)
# Judge status: Wrong Answer
s=input()

ans='No'

for i,ss in enumerate(s):
  if i%2==0:
    if ss =='R' or ss=='U' or ss=='D':
      ans ='Yes'
    else:
      ans='No'
  else:
    if ss=='L' or ss=='U' or ss=='D':
      ans='Yes'
    else:
      ans='No'
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
T = set()
def counter(array):
    from collections import Counter
    return Counter(array)
c = counter(A)
for x in A:
    T.add(x)
cnt = 0
maxi = max(A)
for x in sorted(A):
    i = 2
    while x * i <= maxi:
        if x * i in T:
            T.remove(x*i)
        i += 1
ans = 0
for x in T:
    if c[x] == 1:
        ans += 1
print(ans)
# Judge status: Wrong Answer
s=list(input())
for i in range(s.count("?")):
  s[s.index("?")]="D"
print("".join(s))
# Judge status: Accepted
s = input()
acgt = ["A","C","G","T"]
c = ""
for i in s:
  if i in acgt:
    c+=i
  else:
    c+= " "
l = c.split()
if l:
	print(len(max(l, key=lambda x:len(x))))
else:
  print(0)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
b=[0]*(N+1)#箱

ans=[]
for i in range(N,0,-1):
    bit=0
    for j in range(N//i):
        bit+=b[i+j*i]
    bit%=2
    if bit!=a[i-1]:
        b[i]=1
        ans.append(i)

print(sum(b))
print(' '.join(map(str, ans)))
# Judge status: Accepted


N, R = map(int, input().split())

if N >= 10:
    print(R)
else:
    print(R+100*(10-N))
# Judge status: Accepted
S=input();print('YES' if S.count('7')==1 and S.count('5')==2 else 'NO')
# Judge status: Accepted
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if abs(a-b)<=(v-w)*t:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N,M=map(int,input().split())
ac=0
wa=0
a=[0]*N
w=[0]*N
for i in range(M):
    P,S=input().split()
    P=int(P)
    if S=="WA":
        w[P-1]+=1
    else:
        if a[P-1]==0:
            a[P-1]+=1
            ac=ac+1
            wa+=w[P-1]
        else:
            pass
print(ac,wa)
# Judge status: Accepted
N = list(map(int, input().split()))

N.sort()

print(str(N[0])*N[1])
# Judge status: Wrong Answer
n = input()
if len(n) == 1:
    print(n)
    exit()
if n[0] == '1':
    ans = 0
    judge = set(n[1:])
    if len(judge) == 1 and '9' in judge:
        for i in n:
            ans += int(i)
        print(ans)
    else:
        ans = 9 * (len(n) - 1)
        print(ans)
else:
    ans = int(n[0]) - 1
    for i in range(1,len(n)):
        ans += 9
    print(ans)
# Judge status: Accepted
c = [[int(j) for j in input().split()] for i in range(3)]
flag = True
diffb21 = c[0][1] - c[0][0]
diffb32 = c[0][2] - c[0][1]
for i in range(1, 3):
    if c[i][1] - c[i][0] != diffb21 or c[i][2] - c[i][1] != diffb32:
        flag = False
tc = list(zip(*c))
diffa21 = tc[0][1] - tc[0][0]
diffa32 = tc[0][2] - tc[0][1]
for i in range(1, 3):
    if tc[i][1] - tc[i][0] != diffa21 or tc[i][2] - tc[i][1] != diffa32:
        flag = False
print('Yes' if flag else 'No')
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())

if abs(b - a) > 10**18:
    print('Unfair')
elif k == 0:
    print(a - b)
else:
    print(b - a)
# Judge status: Accepted
import math
a,b,x = list(map(int,input().split()))
bottle = a**2*b
##水の入っていない量について(水が半分以上入っている)
if x>bottle/2:
    p_bottle = bottle-x
    tanx = p_bottle/(a**3)*2
    ans = math.degrees(math.atan(tanx))
else:
    #a*(b**2*tan(90-x))=x
    tan90x=x/(a*b**2)*2
    ans = 90-math.degrees(math.atan(tan90x))
print("{:.10f}".format(ans))
# Judge status: Accepted
S = {
    'a': list(input()[::-1]),
    'b': list(input()[::-1]),
    'c': list(input()[::-1]),
}

s = 'a'
while True:
    if not S[s]:
        print(s.upper())
        exit()
    s = S[s].pop()
# Judge status: Accepted
w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(max(0,a-bw,b-aw))
# Judge status: Accepted
# -*- coding: utf-8 -*-
N, K = map(int, input().split(' '))

import math
ret = 0
log_k = math.log(K)
for n in range(1, N+1):
    prob = 1
    while n < K:
        prob *= 0.5
        n *= 2

    ret += prob


print(ret / N)
# Judge status: Accepted
c = input()
if c == "a" or c == "e" or c == "i" or c == "o" or c == "u":
  print("vowel")
else:
  print("consonant")
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
count = 0
if a == b == c :
  print(-1)
else:
  while a%2 == 1 or b%2 == 1 or c%2 == 1:
    a1 = a
    b1 = b
    c1 = c
    a = a1//2 + b1//2 + c1//2
    b = a1//2 + b1//2 + c1//2
    c = a1//2 + b1//2 + c1//2
    count += 1
  print(count)
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

l = Counter(A)

for i in range(N):
  if i in l:
    print(l[i])
  else:
    print(0)
# Judge status: Accepted
import math

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

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

c = math.gcd(a, b)
print(len(set(prime_factorize(c)))+1)
# Judge status: Accepted
import sys
import math

if __name__ == "__main__":
	n = int(input())
	lst = []
	for _ in range(n):
		lst.append(int(input()))
	q = lst[0]
	for x in range(1, n):
		q = (q*lst[x])//math.gcd(lst[x], q)
	print(q)
# Judge status: Accepted
N  = int(input())
S = list(input())
D = [0]*(N-1)
for i in range(1, N):
  A = S[:i]
  B = S[i:]
  A1 = set(A)
  B1 = set(B)
  C = A1 & B1
  D[i-1] = len(C)
print(max(D))
# Judge status: Accepted
s = int(input())
if s <= 2:
  print(2)
  exit()
elif s <= 3:
  print(3)
  exit()
elif s <= 5:
  print(5)
  exit()

while True:
  for i in range(2,s // 2):
    if s % i == 0:
      break
  if i == s //2 -1:
    print(s)
    exit()
  s += 1
# Judge status: Wrong Answer
h, a = list(map(int, input().split(' ')))
ans = 0
while h > 0:
  h -= a
  ans =+ 1
print(ans)
# Judge status: Wrong Answer
S = input()
X = [chr(i) for i in range(ord('a'), ord('z')+1)]

ans = ''
for x in X:
    if x not in S:
        ans = x
        break
if ans:
    print(ans)
else:
    print('None')
# Judge status: Accepted
import sys
read_=sys.stdin.buffer.readline
x=int(read_())
ans=x//11*2
a=x%11

if 0<a<=6:
    print(ans+1)
elif a==0 and ans>0:
    print(ans)
else:
    print(ans+2)
# Judge status: Accepted
S = input()
remove = len(S) - 7
print('YES' if any(S[:i] + S[i+remove:] == 'keyence' for i in range(8)) else 'NO')
# Judge status: Wrong Answer
d = int(input())

if d == 25:
    print("Christmas")
elif d == 24:
    print("Christmas Eve,")
elif d == 23:
    print("Christmas Eve Eve")
elif d == 22:
    print("Christmas Eve Eve Eve")
# Judge status: Wrong Answer
s = input()
if s == 'AAA' or 'BBB':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
if sum(a)==x:
    print(N)
else:
    a.sort()
    s=0
    i=0
    while True:
       s+=a[i]
       if i==N-1 and s!=x:
           print(N-1)
           break
       if s>x:
           print(i)
           break
       i+=1
       if i>=N:
           print(N)
           break
# Judge status: Wrong Answer
S = input()
T = input()

ans1 = len(T)
ans2 = len(T)
for i in range(len(T)):
    if T[0:i+1] in S:
        ans1 = len(T) - i - 1
    if T[::-1][0:i+1][::-1] in S:
        ans2 = len(T) - i - 1 
print(min(ans1, ans2))
# Judge status: Wrong Answer
import math
a, b, x = map(int, input().split())

xa = math.ceil(a / x)
xb = b // x
print(xb - xa + 1)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1):
    k = n//i
    ans += k*(k+1)//2 * i

print(ans)
# Judge status: Wrong Answer
import sys
base = ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = input()

if not ( S in base ): sys.exit()

print(7 - base.index(S)) if S != 'SUN' else print(0)
# Judge status: Wrong Answer
N = int(input())

pre = 0
for i in range(1, N+1):
  n = i**2
  if n > N:
    print(pre)
    quit()
  
  pre = n
# Judge status: Wrong Answer
n,k= map(int, input().split())
 
#print(n,k)
Ar = [0]*100001
 
for i in range(n):
#	print("i=",i)
	dat = int(input())
	Ar[i] = dat
#	print(Ar)
 
ans = 1000000001
 
for i in range(n-k+1):
	h = Ar[i]
	l = Ar[i]
#	print("Start = ",i)
	for j in range(i,i+k+1):
#		print("check st",j)
		if h < Ar[j]:
			h = Ar[j]
		if l > Ar[j]:
			l = Ar[j]
	if ans > h-l:
		ans = h-l
#	print("diff=",ans,h,l)
 
print (ans)
# Judge status: Wrong Answer
s = input()

former = int(s[:2])
later = int(s[2:])

if former==0 or later==0 or (former>31 and later>31):
  print("NA")
elif former<13 and later<13:
  print("AMBIGUOUS")
elif former<13 and later<32:
  print("MMYY")
elif former<32 and later<13:
  print("YYMM")
else:
  print("NA")
# Judge status: Wrong Answer
import math

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

if 2 * x >= a * a * b:
    bb = x / (a * a)
    c = 2 * (b - bb)
    print(math.degrees(math.atan(c / a)))
else:
    aa = x / (b * b)
    print(math.degrees(math.atan(b / aa)))
# Judge status: Accepted
N = int(input())
aa = []
bb = []
for i in range(N):
    a,b = [int(x) for x in input().split()]
    aa.append(a)
    bb.append(b)
aa.sort()
bb.sort()
if N % 2 != 0:
    print(bb[N//2]-aa[N//2]+1)
else:
    print(bb[N//2]+bb[N//2-1]-aa[N//2]-aa[N//2-1]+1)
# Judge status: Accepted
import math
a, b, h, m = list(map(int, input().split()))
theta = abs(30 * h + (30 / 60 * m) - 6 * m)
theta = math.radians(min(360 - theta, theta))
print((b ** 2 + a ** 2 - 2 * b * a * math.cos(theta)) ** 0.5)
# Judge status: Accepted
A,B= input().split()
A = int(A)
B = int (B)
if A%3 ==0 or B%3 ==0 or (A+B)%3 ==0:
    print ("Possible")
else:
    print ("Impossible")
# Judge status: Wrong Answer
s = str(input())
t = str(input())

if 1 <= len(s) <= 10 and len(t)==len(s) + 1 and s in t :
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X, A, B = map(int, input().split())

if A >= B:
    print('delicious')
elif B <= X + A:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
lst = list(map(int, input().split()))
lst.sort()
lst.reverse()
maximum = int(str(lst[0]) + str(lst[1])) + lst[2]
print(maximum)
# Judge status: Accepted
import math
N,D=map(int,input().split())
count=0
def dist(x,y):
    return math.sqrt(x**2+y**2) 
for i in range(N):
    x,y=map(int,input().split())
    if dist(x,y)<=D:
        count+=1
print(count)
# Judge status: Accepted
def NumberOfMultiples():

    num = list(map(int,input().split()))

    count = 0

    for i in range(num[0], num[1]+1):
        mod = i % num[2]
        
        if mod == 0:
            count = count + 1
    
    print(count)

if __name__ == '__main__':
    NumberOfMultiples()
# Judge status: Accepted
x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b):
    print('A')
else:
    print('B')
# Judge status: Accepted
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    x = I()
    ans = (x//11)*2
    t = x%11
    if t == 0:
        pass
    elif t >= 1 and t <= 6:
        ans += 1
    else:
        ans += 2
    print(ans)

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

for i in range(1,10):
    a=N//i
    if a*i==N:
        print('Yes')
    else:
        pass
print('No')
# Judge status: Accepted
N,M = map(int,input().split())

s = []
g = []
for i in range(M):
    a,b = map(int,input().split())
    if a == 1:
        s.append(b)
    elif b == N:
        g.append(a)
    
ans = set(s) & set(g)

if len(ans) >= 1:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
# Judge status: Accepted
a,b=map(int,input().split())
i=b-a
print(i*(i+1)//2-b)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if c%2==0:
    print ("0")
else:
    print (a*b)
# Judge status: Wrong Answer
s = input()
t = input()
a = sorted(s)
b = sorted(t)
if a==b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from collections import Counter
N = int(input())

A = list(map(int,input().split()))
Q = int(input())

counter = Counter(A)
sum_res = sum(A)
#print(sum_res,counter)
for _ in range(Q):
    bf,af = map(int,input().split())
    sum_res -= bf*counter[bf]
    sum_res += af*counter[bf]
    
    counter[af] += counter[bf]
    counter[bf] = 0
    
    print(sum_res)
# Judge status: Wrong Answer
import sys
import itertools
ABCDlist=list(map(int,list(input())))
#print(ABCDlist)

for bit in itertools.product(range(2),repeat=3):
  answer=ABCDlist[0]
  answer_list=[str(answer)]
  for i in range(3):
    if bit[i]==0:
      answer+=ABCDlist[i+1]
      answer_list.append("+"+str(ABCDlist[i+1]))
    else:
      answer-=ABCDlist[i-1]
      answer_list.append("-"+str(ABCDlist[i+1]))
      
  if answer==7:
    answer_list.append("=7")
    print("".join(answer_list))
    sys.exit(0)
# Judge status: Accepted
s = input()
if s[-1]!="s": print(s+"s")
else: print(s+"es")
# Judge status: Wrong Answer
n = int(input())
AB =[]
total = 0
ans = "Yes"

for i in range(n):
  ab = list(map(int,input().split()))
  AB.append(ab)
  
AB_sorted_second = AB.sort(key=lambda x: x[1])  

for i in range(n):
  if total < AB[i][1]:
    total += AB[i][0]
  else:
    ans = "No"
    break
    
if total > AB[n-1][1]:
  ans = "No"

print(ans)
# Judge status: Accepted
Sa=input()+'A'
Sb=input()+'B'
Sc=input()+'C'
a=0
b=0
c=0
def f(tmp):
  if tmp=='a':
    global a
    out=Sa[a]
    a+=1
  elif tmp=='b':
    global b
    out=Sb[b]
    b+=1
  else:
    global c
    out=Sc[c]
    c+=1
  return out

tmp='a'
while tmp.isupper()==False:
  tmp=f(tmp)
print(tmp)
# Judge status: Accepted
l, r, d = map(int,input().split())
counter = 0
for i in range(l+1, r+1):
    if i % d == 0:
        counter += 1
if d == 1:
    print(counter + 1)
elif l == r:
    if l % d == 0:
        print(1)
    else:
        print(0)
else:
    print(counter)
# Judge status: Accepted
A, B, C = map(int, input().split())
ABC = sorted([A, B, C], reverse=True)
print(int(str(ABC[0]) + str(ABC[1])) + ABC[2])
# Judge status: Accepted
S = int(input())
m = S // (10**9)
n = S % (10**9)

p,q = 0,0
r,s = 0,0
if(m == 10**9):
    p,q = 10**9,1
    r,s = 0,10**9
else:
    p,q = m+1,10**9-n
    r,s = 1,10**9
print(0,0,p,q,r,s)
# Judge status: Accepted
from sys import stdin
import bisect
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
B = [int(x) for x in stdin.readline().rstrip().split()]
C = [int(x) for x in stdin.readline().rstrip().split()]
A.sort()
B.sort()
C.sort()

ans = 0

for b in B:
    a = bisect.bisect_left(A,b)
    c = N - bisect.bisect_right(C,b)
    ans += (a*c)
print(ans)
# Judge status: Wrong Answer
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

for i in range(1,T):
    if A + V * i == B + W * i:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
n=int(input())
s=input()
y=[ord(i)+n for i in s]
for i in y:
    if i>=91:
        i%=91
        print(chr(i+65),end="")
    else:
        print(chr(i),end="")
# Judge status: Wrong Answer
q , h , s , d = map(int,input().split())
n = int(input())
qb = q*4
hb = h*2
db = d//2

if min(qb,hb,db,s) != db:
    print(n*min(qb,hb,db,s))
elif min(qb,hb,db,s) == db:
    if n % 2 == 0:
        print(n*db)
    elif n % 2 == 1:
        ans = n//2 * d
        ans += min(qb,hb,s)
        print(ans)
# Judge status: Accepted
n=int(input())
c=input()
c=list(c)
a=sorted(c)
countw=0
countr=0

for i in range(n):
  if c[i]=='R' and a[i]=='W':
    countw+=1
  elif c[i]=='W' and a[i]=='R':
    countr+=1
    
ansmin=min(countw,countr)
ansmax=max(countw,countr)

print(ansmin+abs(ansmin-ansmax))
# Judge status: Accepted
a, b, c = (int(x) for x in input().split())
if b - a == c - b:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
xl = list(input())

ans = 0
stock = 0
for x in xl:
    if x == "S":
        stock += 1
    else:
        if stock:
            stock -= 1
            ans += 1

print(len(xl)-2*ans)
# Judge status: Accepted

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

if B - A + 1 <= 2*K:
    for i in range(A, B+1):
        print(i)
else:
    for i in range(A,A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))
b=[]
cnt=0

for num in a:
    if num < 0:
        cnt+=1
        b.append(abs(num))
    else:
        b.append(num)

if cnt%2 == 0:
    ans=sum(b)
else:
    ans=sum(b)-2*min(b)

print(ans)
# Judge status: Accepted
s=input()
t=input()

s.split()
t.split()

ans = 0

if s==t:
    print("0")
    exit()

for i in range(len(s)):
    if s[i]!=t[i]:
        ans += 1

print(ans)