peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''

N = int(input())
arr = list(map(int,input().split()))
arr.sort()
ans = 0
for i in range(N-1):
	if arr[i]==arr[i+1]:
		ans = 1
		break

if ans:
	print("NO")
else:
	print("YES")
# Judge status: Wrong Answer
import itertools
N = int(input())

if N == 0:
    print(0)
    exit()
ans = []
while N !=0:
    ans.append(N%2)
    N = -(N-N%2)//2
print("".join(list(map(str,ans))))
# Judge status: Accepted
a,b = map(int,input().split())
print("Yay!") if a<9 and b<9 else print(":(")
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

ans = 'Yes'
for i in range(1, n)[::-1]:
    if h[i] - h[i-1] == -1:
        h[i-1] -= 1
    elif h[i] - h[i-1] < -1:
        ans = 'No'

print(ans)
# Judge status: Accepted
N = int(input())
m = 10**9 + 7
def pos(x, n, m):
    if n == 0:
        return 1
    res = pos(x*x%m, n//2, m)
    if n%2 == 1:
        res = res*x%m
    return res
s = pos(10, N, m)
t = pos(9, N, m)
u = pos(8, N, m)
ans = s + u - t - t
ans = ans % m
print(ans)
# Judge status: Accepted
from collections import Counter

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

for i in range(n):
    s = input()
    l.append(Counter(s))
    
cnt = l[0]
for i in range(1,n):
        cnt = cnt & l[i]
        
print("".join(sorted(cnt.elements())))
# Judge status: Wrong Answer
D = int(input())
c = list(map(int, input().split()))
s = []

for i in range(D):
    tmp = list(map(int, input().split()))
    s.append(tmp)


ans = 0
for l in s:
    l.sort()
    ans += l[0]

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0
"""
ai + i = j - aj
"""
cnt = [0] * (n + 1)
for i in range(n):
    if 0 <= a[i] + i < n+1:
        cnt[a[i] + i] += 1

for i in range(n):
    if i - a[i] >= 0:
        ans += cnt[i - a[i]]

print(ans)
# Judge status: Wrong Answer
import math

tax_8, tax_10 = map(int, input().split())

price_8_min = tax_8 / 0.08
price_8_max = (tax_8 + 0.99) / 0.08

price_10_min = tax_10 / 0.1
price_10_max = (tax_10 + 0.99) / 0.1

if price_8_min <= price_10_max or price_10_min <= price_8_max:
    print(math.ceil(max(price_8_min, price_10_min)))
else:
    print('-1')
# Judge status: Wrong Answer
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

bn = min([a, b, c, d, e])

if bn == n:
    print(5)
    exit()

print((n // bn) + 5)
# Judge status: Accepted
S = input()
N = len(S)

bef = ''
i = 0
count = 0
while i < N:
  s = S[i]
  while s == bef:
    i += 1
    if i >= N:
      print(count)
      exit()
    else:
      s += S[i]
  
  bef = s
  i += 1
  count += 1
  
print(count)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

if (a == b) :
	print('Yes')
elif (a ==c):
	print('Yes')
elif (b == c):
	print('Yes')
else:
	print('No')
# Judge status: Accepted
N = int(input())
TXY = [list(map(int,input().split())) for _ in range(N)]
t = 0
x = 0
y = 0
for txy in TXY:
    T = txy[0]
    X = txy[1]
    Y = txy[2]
    if (T-t) - abs(X-x) - abs(Y-y) >= 0 and ((T-t) - abs(X-x) - abs(Y-y)) % 2 == 0:
        t = T
        x = X
        y = Y
    else:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
# abc136

n,m = map(int,input().split())
days = list(map(int,input().split()))

ans = n - sum(days)
if ans < 0:
    ans = 0
print(ans)
# Judge status: Accepted
N = int(input())
L  = list(map(int, input().split()))

ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                sum_L = L[i] + L[j] + L[k]
                max_L = max(L[i], L[j], L[k])
                if sum_L - max_L > max_L:
                    ans += 1
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    d1 = []
    d2 = []
    for _ in range(n):
        x, y = map(int, input().split())
        d1.append(x + y)
        d2.append(x - y)
    d1.sort()
    d2.sort()
    print(max(d1[-1] - d1[0], d2[-1] - d2[0]))


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import deque


def main():
    N = int(input())

    av = ord('a')

    def to_s(ary):
        ans = "".join(map(lambda v: chr(v + av), ary))
        return ans

    def search(i, v, ary):
        if i == N:
            print(to_s(ary))
            return

        for u in range(0, v + 2):
            ary[i] = u
            search(i + 1, max(u, v), ary)

    ary = [0] * N
    search(0, -1, ary)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
ans=[a*c,a*d,b*c,b*d]
if ((a<0 and b>0) and d<0) or ((c>0 and d>0) and b<0):
    print(0)
else:
    print(max(ans))
# Judge status: Accepted
import itertools
import math
N = int(input())
XY = [list(map(int,input().split())) for i in range(N)]
L = 0#経路長の和
for i in list(itertools.permutations(XY)):#順列に対し
    distance = 0
    for n in range(N-1):#経路長を求める
        distance += math.sqrt((i[n+1][0]-i[n][0])**2 + (i[n+1][1]-i[n][1])**2)
    L += distance
print(L/math.factorial(N))
# Judge status: Accepted
n=int(input().replace(' ',''))
a=int(n**.5)
print('Yes' if n==a**2 else 'No')
# Judge status: Accepted
w,a,b=map(int,input().split())
#a,a+w b,b+w
if b<=a<=b+w or a<=b<=a+w:
  print(0)
else:
  print(min(abs(b-a-w),abs(b+w-a)))
# Judge status: Accepted
n,a, b = map(int, input().split( ))
if (a-b)%2==0:
    print(abs(a-b)//2)
    exit()

if a<b:
    a,b = b,a
ans1 = b-1+(a-b+1)//2
ans2 = (n-a) + (n-(b+n-a)+1)//2

print(min(ans1,ans2))
# Judge status: Accepted
#58B
A=list(input())
B=list(input())
x=A[0]+B[0]
for i in range(1,len(B)):
    x=x+A[i]+B[i]
if len(A)>len(B):
    x=x+A[-1]
print(x)
# Judge status: Wrong Answer
li = []
s = input()
li2 = []
for i in range(4):
  li.append(int(s[i]))
n1 = 4
def func(n, t):
  if n == 0:
    if t == 0:
      return True
    else:
      return False
  elif func(n-1, t+li[n-1]):
    li2.append('-')
    return True
  elif func(n-1, t-li[n-1]):
    li2.append('+')
    return True
  else:
    return False
if func(n1, 7):
  print("{0}{4}{1}{5}{2}{6}{3}=7".format(li[0], li[1], li[2], li[3], li2[0], li2[1], li2[2]))
# Judge status: Accepted
n = int(input())
MOD = 10**9+7

def f(num):
    return pow(num, n, MOD)

print((f(10)-f(9)-f(9)+f(8))%MOD)
# Judge status: Wrong Answer
n=int(input())
s = [input() for i in range(n)]
num = 0
for i in range(len(s)):
    if i-1<0 or s[i] != s[i-1]:
        num = num + 1

print(num)
# Judge status: Wrong Answer
K, A, B = map(int, input().split())

bisket = 1
money = 0

if B / A > 2:
    remain = K - A + 1
    bisket = A
    bisket += remain // 2 * (B - A)
    if remain % 2 == 1:
        bisket += 1
else:
    bisket += K

print(bisket)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=0
c=0
for i in range(n):
  if a[i]%2==0:
    if a[i]%4==0:
      c+=1
    else:
      b+=1
print("Yes") if n<= b+3*c-1 else print("No")
# Judge status: Wrong Answer
s = list(input())
a = s[0]
cou = 0
i = 0
while i!=len(s)-1 and i!=len(s)-2:
  if s[i]!=a:
    cou += 1
    a = s[i]
    i += 1
   # print(0,a,cou,i)
  else:
    a = "".join(s[i:i+2])
    cou += 1
    i += 2
  #  print(10,a,cou,i)
if s[-1]==a:
  print(cou)
else:
  print(cou+1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

res = 0
rem = 0

for i in range(N):
    mobs_rem = min(A[i], rem)
    A[i] -= mobs_rem
    mobs = min(A[i], B[i])
    rem = B[i] - mobs
    res += (mobs+mobs_rem)

res += min(A[N], rem)
print(res)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0
for i in range(0, a + 1):
    for j in range(0, b + 1):
        for k in range(0, c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                count += 1
print(count)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
cnt=0
for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    cnt+=1
  if cnt==c:
    print(i)
    break
# Judge status: Accepted
N = int(input())
count = 0
num = 1

while N >= num:
    count += 1
    num *= 2

print(num // 2)
# Judge status: Accepted
import numpy as np
l = np.array([int(input()) for _ in range(5)])
m = ((l+9)//10)*10
n = max(m-l)
#print(l)
#print(m)
#print(n)
print(sum(m)-n)
# Judge status: Wrong Answer
N = int(input())
D = list(map(int, input().split()))
D.sort()
if D.pop(0) != 0:
  ans = 0
else:
  ans = 1
  num = 1
  before = 1
  after = 0
  for i in D:
    if i == num:
      after += 1
    elif i == num+1:
      ans *= before**after
      num += 1
      before = after
      after = 1
    else:
      ans = 0
  ans *= before**after
print(ans)
# Judge status: Accepted
N, X = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
res = 0
for a in A:
    if a > X:
        break
    res += 1
    X -= a
else:
    if X > 0:
        res -= 1
print(max(res, 0))
# Judge status: Accepted
H1, M1, H2, M2, K = map(int, input().split())

H1 = H1 * 60
H2 = H2 * 60

print(((H2 + M2)-K)-(H1+M1))
# Judge status: Accepted
import numpy as np

A=[list(map(int, input().split())) for _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]

for b in B:
	for i in range(3):
		for j in range(3):
			if A[i][j]==b:A[i][j]=0
			
ans_axis0=np.sum(np.array(A),axis=0)
ans_axis1=np.sum(np.array(A),axis=1)
ans_naname=[A[0][0]+A[1][1]+A[2][2],A[0][2]+A[1][1]+A[2][0]]

#print(A,ans_axis0,ans_axis1,ans_naname)

if 0 in ans_axis0 or 0 in ans_axis1 or 0 in ans_naname:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def main():
    N, X, *xn = map(int, open(0).read().split())
    ans = None
    for x in xn:
        div = abs(X - x)
        if ans is None:
            ans = div
        elif div % ans:
            ans = gcd(ans, div)
    print(ans)
    return


main()
# Judge status: Accepted
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

k,a,b = MI()

if a+2 >= b:
    print(1+k)
elif a >= k+2:
    print(1+k)
elif (k-a+1)%2 == 0:
    print((k-a+1)//2*(b-a)+a)
else:
    print((k-a+1)//2*(b-a)+a+1)
# Judge status: Accepted
s = input()

day = {'SUN':7, 'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'SAT':1}

print(day[s])
# Judge status: Wrong Answer
import math
n,*l=map(int,open(0).read().split())
print(n+math.ceil(n//min(l)))
# Judge status: Wrong Answer
S = input()
T = input()
ansind = None
def solve(i):
  flag = True
  for j in range(len(T)):
    if i+j < len(S) and (S[i+j] == "?" or S[i+j] == T[j]):
      continue
    else:
      flag = False
      break
  return flag

for i in range(len(S)):
  if solve(i):
    ansind = i
if ansind:
  ans = S[:ansind] + T + S[ansind+len(T):]
  ans = ans.replace("?", "a")
else:
  ans = "UNRESTORABLE"
print(ans)
# Judge status: Wrong Answer
n,b,r = map(int,input().split())
syo = n//(b+r)
amari = n%(b+r)
if amari == 0:
  print(b*syo)
else:
  if amari <= b:
    print(b*syo + amari)
  else:
    print(b*syo - (b-amari))
# Judge status: Accepted
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())))
if k == 0:
    print(sum(h))
else:
    print(sum(h[:-k]))
# Judge status: Accepted
N=int(input())
p=[0]
q=[0]
A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
for i in range(N):
  p.append(p[i]+A1[i])
  q.append(q[i]+A2[N-i-1])
ans=0
for j in range(N):
  ans=max(ans,p[j+1]+q[N-j])
print(ans)
# Judge status: Accepted
import sys
N = int(input())
D = []
for i in range(N):
    D.append(input().split())
cnt = 0
for i in range(N):
    if D[i][0] == D[i][1]:
        cnt += 1
        if cnt == 3:
            print("Yes")
            sys.exit()
    else:
        cnt = 0
print("No")
# Judge status: Accepted
s = input("")
if s[-1] == 's':
    print(s + 'es')
else:
    print(s + 's')
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())), reverse = True)
d = 0
for i in range(n):
    d += ((-1)*a[i]) if i%2 else a[i]
print(d)
# Judge status: Wrong Answer
A, B = map(int, input().split()) 
sum = A + B
if sum > 24:
  sum = sum - 24
print(sum)
# Judge status: Accepted
# abc112_b.py
N, T = map(int,input().split())
C = [map(int,input().split()) for i in range(N)]
ans = 10001
for c,t in C:
    if t <= T and ans > c:
        ans = c
if ans <1001:
    print(ans)
else:
    print("TLE")
# Judge status: Wrong Answer
ans=0
n=int(input())
a=[int(input()) for _ in range(n)]
a.sort()
res=a[0]
cnt=1

for i in a[1:]:
    if res==i:
        cnt+=1
    else:
        if cnt%2!=0:
            ans+=1
            res=i
            cnt=1
        else:
            res=i
            cnt=1
            
print(ans)
# Judge status: Wrong Answer
def main():
    n = int(input())
    ans = 0 
    ans += (n) * (n + 1) / 2
    print(int(ans) - n)

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

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

result = 0
for i in range(0, len(mulArr) - 2):
  print(i)
  if mulArr[i][0] == mulArr[i][1] and mulArr[i + 1][0] == mulArr[i + 1][1] and mulArr[i + 2][0] == mulArr[i + 2][1]:
    result += 1

print(result)
if result != 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b,c = map(int, input().split())
k = int(input())

n = max(a,b,c)
ans = sum([a,b,c]) - n
for _ in range(k):
  n *= 2
print(ans+n)
# Judge status: Accepted
# ABC 120: A – Favorite Sound
a, b, c = [int(s) for s in input().split()]
print(c if b // a > c else b // a)
# Judge status: Accepted
n=int(input())
alphabet = [chr(i) for i in range(97, 97+26)]

ans=[]
while n>0:
    n-=1
    ans.append(alphabet[n%26])
    n//=26
ans.reverse()
print(''.join(ans))
# Judge status: Accepted
N,X=map(int,input().split())
x=[abs(int(i)-X) for i in input().split()]

import fractions as math
ans=x[0]
for j in range(1,N):
  ans=math.gcd(ans,x[j])
print(ans)
# Judge status: Wrong Answer
A,B,C,D = map(int,input().split())

import math

numC = 0
numD_C = 0

cA = math.ceil(A/C)
cB = math.ceil(B/C)
dA = math.ceil(A/D)
dB = math.ceil(B/D)

i = 1
num = 0

while A <= C*D*i <=B:
    num += 1
    i += 1

ans = B-A +1-(abs(cB-cA) + abs(dB-dA) - num)

print(ans)
# Judge status: Accepted
S=input()
day=S[-6:]
print("2018"+day)
# Judge status: Accepted
X = int(input())
if (400<=X<=599):
  print(8)
elif (600<=X<=799):
  print(7)
elif (800<=X<=999):
  print(6)
elif (1000<=X<=1199):
  print(5)
elif (1200<=X<=1399):
  print(4)
elif (1400<=X<=1599):
  print(3)
elif (1600<=X<=1799):
  print(2)
elif (1800<=X<=1999):
  print(1)
else:
  print(0)
# Judge status: Wrong Answer


import numpy as np
import fractions as fra

x,a,b=map(int,input().split())
if(a>=b):
    print("delicious")
elif(x>=b):
    print("safe")
else:
    print("dangerous")
# Judge status: Wrong Answer
from sys import stdin
input = lambda: stdin.readline().rstrip("\r\n")
from collections import defaultdict as vector, deque as que
read = lambda: list(map(int,input().split()))
from bisect import bisect
from heapq import heappush as hpush,heappop as hpop

n,m,k=read()
A=read()
B=read()
a,b=[0],[0]
for i in range(n):
	a.append(a[i]+A[i])
for i in range(m):
	b.append(b[i]+B[i])
ans=0
for i in range(1,n+1):
	curr=a[i]
	j=m
	if curr>k:
		break
	while(b[j]>k-curr):
		j-=1
	ans=max(ans,i+j)
print(ans)
# Judge status: Wrong Answer
li = input().split()
count = int(li[0])
price = int(li[1]) / 1000
errorText = '-1 -1 -1'
ans = True
flag = False
for a in range(count+1):
    for b in range(count - a +1):
        c = count - a-b
        fee = a*10 + b*5 + c*1

        if fee == price and a+b+c == count:
            print(str(a) + " " + str(b) + " " + str(c))
            ans = False
            # flag = True
            break
    if flag:
        break

if ans is not False:
    print(errorText)
# Judge status: Wrong Answer
D, T, S = map(int, input().split())

if D / S <= T:
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
s = input()
t = input()
N = len(s)
n = len(t)
m = 0
for i in range(N-n):
    cnt = 0
    S = list(s)[i:i+n]
    T = list(t)
    for j in range(n):
        if S[j] == T[j]:
            cnt += 1
    if m < cnt:
        m = cnt
print(n-m)
# Judge status: Accepted
def main():
  s=input()
  if s == "ABC" :
    print("ARC")
  else:
    print("ABC")

main()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

res = 0
pre = a[0]
for i in range(1, n):
    if pre <= a[i]:
        pre = a[i]
        continue
    res += pre - a[i]
print(res)
# Judge status: Accepted
N = int(input().strip())
X = sorted([int(v) for v in input().strip().split()])

c = 100000000000000000
for p in range(X[0], X[-1] + 1):
    P = sum([pow(x - p, 2) for x in X])
    if P >= c:
        break
    c = P
print(c)
# Judge status: Accepted
def main():
    n, k, q = map(int, input().split())
    point = [0]+[k-q]*n

    for a in range(q):
        point[int(input())] += 1

    for i in point[1:]:
        if i <= 0:
            print("No")
        else:
            print("Yes")


if __name__ == '__main__':
    main()
# Judge status: Accepted
cards = [int(i) for i in input().split(" ")]
print("bust" if sum(cards) >= 22 else "win")
# Judge status: Accepted
s = int(input())
n = 1
while 1:
  if s == 1 or s == 2 or s == 4:
    print(n+3)
    break
  if s % 2 == 1:
    s = 3 * s + 1
  else:
    s //= 2
  n += 1
# Judge status: Accepted
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()
x=nl()

sx = sorted(x)[::-1]

c = n//2

for i in range(n):
  if x[i] > sx[c]:
    print(sx[c])
  else:
    print(sx[c-1])
# Judge status: Wrong Answer
n =str(input())
r =str(input())
s = len(n)
if  n== r[0:s+1]  :
    print('Yes')
else :
    print('No')
# Judge status: Accepted
import sys

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


def main():
    n, x = map(int, readline().split())
    a = list(map(int, readline().split()))
    a.sort()

    rem = x
    ans = 0

    for i in range(n - 1):
        if rem >= a[i]:
            rem -= a[i]
            ans += 1

    if a[n-1] == rem:
        ans += 1

    print(ans)


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

i = 1
li = []
for j in range(N):
    if ((i % 3) == 0) or ((i % 5) == 0):
        i = i + 1
    else:
        li.append(i)
        i = i + 1
        
print(sum(li))
# Judge status: Accepted
s = list(input())

ans = []
for i in range(0,len(s)-2):
  d = int("".join(s[i]+s[i+1]+s[i+2]))
  ans.append(abs(d-753))
  
print(min(ans))
# Judge status: Wrong Answer
A, B, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = [input().split() for i in range(m)]
ans = min(a) + min(b)
for i in range(m):
    ai = a[int(l[i][0]) - 1]
    bi = b[int(l[i][1]) - 1]
    ci = int(l[i][2])
    nc = ai + bi - ci
    ans = min(ans, nc)
print(nc)
# Judge status: Accepted
n = int(input())
S = [input() for _ in range(n)]

import hashlib
base1 = 1007
mod1 = 10**9+7
dic = {}

for s in S:
  hs = hashlib.md5(s.encode()).hexdigest()
  dic.setdefault(hs, s)

print(len(dic))
# Judge status: Wrong Answer
L, R, d = [int(x) for x in input().split()]

mod = (L+d) % d
# print((R - L - mod) // d)
lst = list(range(L+mod, R+1, d))
print(list(lst))
print(len(lst))
# Judge status: Wrong Answer
s = input()
if 'a' in s and 'b' in s and 'c' in s:
  print("Yes")
else:
  print("NO")
# Judge status: Accepted
S = input()
cnt = 0
if S[0] == "A":
    for i in S[2: len(S) - 1]:
        if i == "C":
            cnt += 1
sr = S.replace("A", "")
src = sr.replace("C", "")
if src.islower() and cnt == 1:
    print("AC")
else:
    print("WA")
# Judge status: Accepted
import numpy as np

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

A = np.array(A)
A_all = np.sum(A)

if H <= A_all:
    print('Yes')
else:
    print('No')
# 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 = sorted(p, reverse=True)[:x]
q = sorted(q, reverse=True)[:y]

total = sorted(p+q+r, reverse=True)[:x+y]
print(sum(total))
# Judge status: Wrong Answer
N=int(input())
X=list(map(int,input().split()))
p=sum(X)//len(X)
ans=0
for i in range(len(X)):
    ans+=(X[i]-p)**2
print(ans)
# Judge status: Wrong Answer
n=int(input())
p=list(map(int,input().split()))
minnumber=100001
count=0

for i in p:
  if i<=minnumber:
    count+=1
    minnumber=i
    
print(count)
# Judge status: Accepted
a = int(input())
print(a + a **2 + a **3)
# Judge status: Wrong Answer
N = int(input())#支払額
A = int(input())#1円の所持数
B = N % 500
if A > B:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, k = map(int, input().split())
lst = range(a, b+1)
for i in sorted(set(lst[:k]) | set(lst[-k:])):
  print(i)
# Judge status: Accepted
from collections import deque
K = int(input())
q = deque([i for i in range(1, 10)])

# print(q)
for i in range(K):
    x = q.popleft()
    if x % 10 != 0:
        q.append(10*x+x % 10-1)
    q.append(10*x+x % 10)
    if x % 10 != 9:
        q.append(10*x+x % 10+1)

print(x)
# Judge status: Accepted
A, B, C, D = map(int, input().split())
ans = -1

AB = [i for i in range(A, B+1)]
CD = [i for i in range(C, D+1)]

for sec in AB:
    if sec in CD:
        ans += 1

if ans == -1:
    print(0)
else:
    print(ans)
# Judge status: Accepted
s = list(input())
t = list(input())

ans = len(t)
if len(s) == len(t):
    icchi = 0
    for i in range(len(s)):
        if s[i] == t[i]:
            icchi += 1
    ans = len(t)-icchi
else:
    for i in range(len(s)-len(t)):
        a = s[i:i + len(t)]
        icchi = 0
        for j in range(len(t)):
            if a[j] == t[j]:
                icchi += 1
        ans = min(ans, len(t)-icchi)


print(ans)
# Judge status: Accepted
def check_month(n):
  return 1 <= n <= 12
def check_year(n):
  return 0 <= n <= 99

S = input()
Y = int(S[:2])
M = int(S[2:])
if check_month(Y) and check_month(M):
  print('AMBIGUOUS')
elif check_month(Y) and check_year(M):
  print('MMYY')
elif check_year(Y) and check_month(M):
  print('YYMM')
else:
  print('NA')
# Judge status: Accepted
import sys
import math
from collections import Counter


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

S = Counter(s)
a = S["a"]
b = S["b"]
c = S["c"]

if abs(a-b) <= 1 and abs(a-c) <= 1 and abs(c-b) <= 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a,b,c,d = map(int,input().split())

a2 = a
c2 = c
while True:
  c2-=b
  if c2 <= 0:
    print('Yes')
    exit()
  a2-=d
  if a2 <= 0:
    print('No')
    exit()
# Judge status: Accepted
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n + 1):
    su = sum(map(int, list(str(i))))
    if a <= su <= b:
        ans += i
print(ans)
# Judge status: Accepted
N = int(input())
lis = list(map(int, input().split()))
lis.sort(reverse=True)
lis = lis[1::2]

ans = 0

for i in range(N):
    ans += lis[i]

print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
answer = 0
while not (a == b == c):
    a, b, c = sorted([ a, b, c ])
    if a + 2 <= c:
        a += 2
    else:
        a += 1
        b += 1
    answer += 1
print(answer)
# Judge status: Wrong Answer
N = int(input())
S = int(N / 1.08)
if S * 1.08 < N or S * 1.08 >= N + 1:
  print(":(")
else:
  print(S)
# Judge status: Accepted
s = int(input())
if round(s**0.5)**2==s:
    tmp = round(s**0.5)
    print(0, 0, tmp, 0, 0, tmp)
    exit()
i = int(s**0.5)+1
for j in range(i, 0, -1):
    if i*j<s:
        print(0, 0, i, 1, i*(j+1)-s, j+1)
        break