local function meld(node1,node2) if not node1 then return node2 elseif not node2 then return node1 elseif node1[1]n then A[1]=math.floor((A[1]+b[j%n])/2) A[2]=A[2]+1 pq:push(A[1],A) else A[1]=math.floor((A[1]+b[j])/2) A[2]=A[2]+1 pq:push(A[1],A) end end local max=0 for j=1,n do local a=pq:top() pq:pop() max=math.max(a[2],max) end min=math.min(max,min) end print(min)