N = int(eval(input()))

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

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



if sum(A) < sum(B):

    print((-1))

    exit(0)



t = 0

m = 0

L = []

for k in range(N):

    if A[k] > B[k]:

        L.append(A[k]-B[k])

    else:

        m += B[k] - A[k]

        t += 1



if m == 0:

    print((0))

    exit(0)



L = (sorted(L))[::-1]

for e in L:

    m -= e

    t += 1

    if m <= 0:

        break

print(t)
N = int(eval(input()))

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

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

if sum(A) < sum(B):

    print((-1))

    exit(0)



C = [A[k]-B[k] for k in range(N)]

C.sort()

t = 0

ans = 0

for k in range(N):

    if C[k] >= 0:

        break

    else:

        t -= C[k]

        ans += 1



for k in range(N-1,-1,-1):

    if t <= 0:

        break

    else:

        t -= C[k]

        ans += 1



print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
if sum(A) < sum(B):
    print((-1))
    exit(0)
t = 0
m = 0
L = []
for k in range(N):
    if A[k] > B[k]:
        L.append(A[k] - B[k])
    else:
        m += B[k] - A[k]
        t += 1
if m == 0:
    print((0))
    exit(0)
L = (sorted(L))[::-1]
for e in L:
    m -= e
    t += 1
    if m <= 0:
        break
print(t)

N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
if sum(A) < sum(B):
    print((-1))
    exit(0)
C = [A[k] - B[k] for k in range(N)]
C.sort()
t = 0
ans = 0
for k in range(N):
    if C[k] >= 0:
        break
    else:
        t -= C[k]
        ans += 1
for k in range(N - 1, -1, -1):
    if t <= 0:
        break
    else:
        t -= C[k]
        ans += 1
print(ans)

+C = [A[k] - B[k] for k in range(N)] +C.sort() -m = 0 -L = [] +ans = 0 -    if A[k] > B[k]: -        L.append(A[k] - B[k]) +    if C[k] >= 0: +        break -        m += B[k] - A[k] -        t += 1 -if m == 0: -    print((0)) -    exit(0) -L = (sorted(L))[::-1] -for e in L: -    m -= e -    t += 1 -    if m <= 0: +        t -= C[k] +        ans += 1 +for k in range(N - 1, -1, -1): +    if t <= 0: -print(t) +    else: +        t -= C[k] +        ans += 1 +print(ans)