import heapq
def solution(scoville, K):
answer = 0
if(K==0):
return 0
heapq.heapify(scoville)
while len(scoville)>1:
first=heapq.heappop(scoville)
seconde=heapq.heappop(scoville)
result=first+(seconde*2)
heapq.heappush(scoville,result)
answer+=1
if(scoville[0]>K):
return answer
return -1