def solution(people, limit):
answer = 0
people.sort() # 몸무게 오름차순으로 정렬
start, end = 0, len(people) - 1
while True:
if people[start] + people[end] > limit:
end -= 1
answer += 1
else:
start += 1
end -= 1
answer += 1
if start > end:
break
elif start == end:
if people[start] <= limit:
answer += 1
break
return answer