Segment tree based solution, beats 88% solutions in time and 96% solutions in memory
```\n#define MAXN 100001\nclass Solution {\npublic:\n    int seg[4MAXN];\n    void update(int ind,int l,int r,int i,int x)\n    {\n        if(ind>r||indr) retur
```\n#define MAXN 100001\nclass Solution {\npublic:\n    int seg[4*MAXN];\n    void update(int ind,int l,int r,int i,int x)\n    {\n        if(ind>r||ind<l||l>r) return ;\n        if(l==r)\n        {\n            if(l==ind)\n                seg[i]=x;\n            return ;\n        }\n        int mid=(l+r)/2;\n        update(ind,l,mid,2*i+1,x);\n        update(ind,mid+1,r,2*i+2,x);\n        seg[i]=min(seg[2*i+1],seg[2*i+2]);\n    }\n    int query(int st,int en,int l,int r,int i,int x)\n    {\n        //cout<<l<<" "<<r<<"\\n";\n        if(st>en||l>en||r<st||seg[i]>x)\n            return -1;\n        if(l==r) \n            return l;\n        int mid=(l+r)/2;\n        int lf=query(st,en,l,mid,2*i+1,x);\n        if(lf!=-1)\n            return lf;\n        int rf=query(st,en,mid+1,r,2*i+2,x);\n        return rf;\n    }\n    int que(int st,int en,int l,int r,int i,int x)\n    {\n        if(st>en||l>en||r<st||seg[i]>x)\n            return -1;\n        if(l==r) \n            return l;\n        int mid=(l+r)/2;\n        int rf=que(st,en,mid+1,r,2*i+1,x);\n        if(rf!=-1)\n            return rf;\n        int lf=que(st,en,l,mid,2*i+2,x);\n        return lf;\n    }\n    vector<int> busiestServers(int k, vector<int>& arr, vector<int>& lo) {\n        int i,j,n=arr.size();\n        j=-1;\n        vector<int> b(n,0),ans;\n        map<int,int> m;\n        for(i=0;i<n;i++)\n        {\n            int x=query(i%k,k-1,0,k-1,0,arr[i]);\n            if(x!=-1)\n            {\n                //cout<<1<<" "<<x<<" "<<i<<"\\n";\n                m[x]++;\n                b[x]=arr[i]+lo[i];\n                update(x,0,k-1,0,b[x]);\n                continue;\n            }\n            int y=query(0,i%k-1,0,k-1,0,arr[i]);\n            if(y!=-1)\n            {\n                //cout<<2<<" "<<y<<" "<<i<<"\\n";\n                m[y]++;\n                b[y]=arr[i]+lo[i];\n                update(y,0,k-1,0,b[y]);\n            }\n        }\n        int maxi=0;\n        for(auto e:m)\n            maxi=max(maxi,e.second);\n        // for(auto e:m)\n        // cout<<e.first<<" "<<e.second<<"\\n";\n        for(auto e:m)\n        {\n            if(e.second==maxi)\n                ans.push_back(e.first);\n        }\n        return ans;\n    }\n};
['Tree', 'Binary Tree']