n=int(eval(input()))

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

a.sort(reverse=True)

b=[0]

for i in a:

    b.append(i+b[-1])

ans=1

for i in range(1,n):

    if b[i]-b[i-1]<=2*(b[-1]-b[i]):

        ans+=1

    else:break

print(ans)
n=int(eval(input()))

t=sorted(map(int, input().split()),reverse=True)

sm=sum(t)

ans=0

for i in t:

    sm-=i

    ans+=1

    if i>sm*2:

        break

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
b = [0]
for i in a:
    b.append(i + b[-1])
ans = 1
for i in range(1, n):
    if b[i] - b[i - 1] <= 2 * (b[-1] - b[i]):
        ans += 1
    else:
        break
print(ans)

n = int(eval(input()))
t = sorted(map(int, input().split()), reverse=True)
sm = sum(t)
ans = 0
for i in t:
    sm -= i
    ans += 1
    if i > sm * 2:
        break
print(ans)

-a = list(map(int, input().split())) -a.sort(reverse=True) -b = [0] -for i in a: -    b.append(i + b[-1]) -ans = 1 -for i in range(1, n): -    if b[i] - b[i - 1] <= 2 * (b[-1] - b[i]): -        ans += 1 -    else: +t = sorted(map(int, input().split()), reverse=True) +sm = sum(t) +ans = 0 +for i in t: +    sm -= i +    ans += 1 +    if i > sm * 2: