항구에는 크레인이 N대 있고, 1분에 박스를 하나씩 배에 실을 수 있다. 모든 크레인은 동시에 움직인다.
import sys
n = int(input())
cranes = list(map(int,input().split()))
m = int(input())
boxs = list(map(int,input().split()))
if max(cranes) < max(boxs): # 박스의 최대무게가 크레인의 최대 무게보다 크면 어차피 박스를 다 못옮기므로 -1
print(-1)
else:
# 크레인,박스 둘다 내림차순 정렬
cranes.sort(reverse = True)
boxs.sort(reverse = True)
time = 0
while boxs:
for i in cranes:
for idx,j in enumerate(boxs):
if i >= j:
boxs.pop(idx) # box.remove(j) 와 시간복잡도는 같다
break # 박스를 옮길시, 다음 크레인차례
time += 1
print(time)