Python using 2 heaps, one for blocked machine, one for next available
heap for blocked servers are easy to think for me.\nthe next available heapq will always give i%k highest priority and so on\n\n\n\tdef busiestServers(self, k: 
heap for blocked servers are easy to think for me.\nthe next available heapq will always give i%k highest priority and so on\n\n\n\tdef busiestServers(self, k: int, arrival: List[int], load: List[int]) -> List[int]:\n        hq=[] # heap order by free time\n\t\thqs=[i for i in range(k)] # constant length heap , order by index\n        l=[0 for i in range(k)]\n        for i in range(len(arrival)):\n            #free all the available machine and push into index based heap \n            while hq:\n                \n                if hq[0][0]<=arrival[i]:\n                    t=heapq.heappop(hq)\n                    if t[1]%k>=i%k:\n                        heapq.heappush(hqs,t[1]%k+(i//k)*k)\n                    else:\n                        heapq.heappush(hqs,t[1]%k+(i//k+1)*k)\n                    #print(i,t)\n                else:\n                    break\n            #get first available index (i%k has priority)\n            if hqs:\n                t=heapq.heappop(hqs)\n                j=t%k\n                l[j]+=1\n                heapq.heappush(hq,(arrival[i]+load[i],j%k))\n            \n        ans=[]\n        mmm=max(l)\n        #print(l)\n        for i in range(k):\n            if l[i]==mmm:\n                ans.append(i)\n        return ans\n
[]