import sys sys.setrecursionlimit(10 ** 6) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) class Box: def __init__(self, cnt, toy): self.cnt = cnt self.toy = toy def __lt__(self, other): return self.cnt < other.cnt or (self.cnt == other.cnt and self.toy < other.toy) def main(): n=II() aa=LI() m=II() bb=LI() bb.sort(reverse=True) dp=[Box(100,100)]*(1<>j&1:continue a=aa[j] if toy+a<=bb[cnt]:value=Box(cnt,toy+a) elif cnt+1<=m-1 and a<=bb[cnt+1]:value=Box(cnt+1,a) else:continue ni=i|1<