
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can maintain a Heap of available Servers and a Heap of unavailable servers
Note that the tasks will be processed in the input order so you just need to find the x-th server that will be available according to the rules