https://school.programmers.co.kr/learn/courses/30/lessons/12927
import heapq
def solution(n, works):
if sum(works) <= n :
return 0
work = [-w for w in works]
heapq.heapify(work)
for _ in range(n):
heapq.heappush(work, heapq.heappop(work) + 1)
return sum([w**2 for w in work])