CPP PQ + Set + Micro-optimisation
Reference of this and similar who used PQ and OrderedSet to maintain available servers and load: https://leetcode.com/problems/find-servers-that-handled-most-nu
Reference of this and similar who used PQ and OrderedSet to maintain available servers and load: https://leetcode.com/problems/find-servers-that-handled-most-number-of-requests/solutions/963917/python-two-priorityqueue-back-and-forth-o-n-log-k

Optimisation:
1. first K request are directly going to K servers, so no need initialise availableServers set, just initialise priority_queue with the endTime of k jobs with the server index
2. starting from K+1 job, first check, if we are already having server == i%K available, if yes, dont do anything => just assign that server to ith job, and your work is done
3. if 2nd step not worked, then remove all the jobs which has endTime <= arrival time of current job, keep adding the available servers to the Ordered set. Once all stale jobs are removed, try to find lower_bound on i%k.
# Code
```cpp []
class Solution {
public:
    //GREAT QUESTION
    vector<int> busiestServers(int k, vector<int>& arrival, vector<int>& eTime) {
        set<int> availableServers;
        int n = arrival.size();
        vector<int> serverUsed(k, 0);

        priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> load;
        for(int i = 0; i < min(n,k); i++){
            serverUsed[i]++;
            load.emplace(eTime[i]+arrival[i],i);
        }

        for(int i = min(n,k); i < n; i++){
            int endTime = arrival[i] + eTime[i];
            if(availableServers.find(i % k) != availableServers.end()){
                serverUsed[i%k]++;
                load.emplace(endTime, i%k);
                availableServers.erase(i%k);
                continue;
            }
            while(!load.empty() && load.top().first <= arrival[i]){
                pair<int,int> nowAvailableServer = load.top();
                load.pop();
                availableServers.insert(nowAvailableServer.second);
            }
            if(availableServers.size() == 0){
                continue;
            }
            auto server = availableServers.lower_bound(i%k);
            if(server == availableServers.end()){
                server = availableServers.begin();
            }
            serverUsed[*server]++;
            load.emplace(endTime, *server);
            availableServers.erase(server);
        }
        
        int maxElem = *max_element(serverUsed.begin(), serverUsed.end());
        vector<int> ans;
        for(int i = 0; i < serverUsed.size(); i++){
            if(maxElem == serverUsed[i]){
                ans.push_back(i);
            }
        }
        return ans;
    }
};
```
['C++']