Segment Tree +  Coordinate Compression + Sorting (C++)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nbool compare(const vector<int>&v1,const vector<int>&v2)\n{\n    return v1[0] > v2[0];\n}\nclass Solution {\npublic:\n    void update(int s,int e,const int indx,const int val,int node,vector<int>&segtree)\n    {\n        if(s == e)\n        {\n            // there can be multiple values of index indx so we choose with the max value\n            segtree[node] = max(segtree[node],val); \n            return;\n        }\n        int mid = (s+e)/2;\n        if(indx <= mid) update(s,mid,indx,val,2*node+1,segtree);\n        else update(mid+1,e,indx,val,2*node+2,segtree);\n        segtree[node] = max(segtree[2*node+1],segtree[2*node+2]);\n    }\n    int query(int s,int e,const int l,const int r,int node,const vector<int>&segtree)\n    {\n        if(l > e or r < s) return -1;\n        if(l <= s and e <= r) return segtree[node];\n        int mid = (s+e)/2;\n        int op1 = query(s,mid,l,r,2*node+1,segtree);\n        int op2 = query(mid+1,e,l,r,2*node+2,segtree);\n        return max(op1,op2);\n    }\n    vector<int> maximumSumQueries(vector<int>& nums1, vector<int>& nums2, vector<vector<int>>& queries) {\n        int n = nums1.size();\n        int m = queries.size();\n        vector<pair<int,int>> v(n);\n        // sort nums1 and nums2 according to x which is nums1\n        for(int i = 0 ; i < n ; ++i)\n            v[i] = {nums1[i],nums2[i]}; // (x,y)\n        sort(v.begin(),v.end());\n        // coordinate compression of y as y is upto 1e9 would make it difficult\n        // to create a segment tree without it\n        set<int> s;\n        for(int &y : nums2)\n            s.insert(y);\n        for(auto &node : queries)\n            s.insert(node[1]);\n        map<int,int> cord;\n        int tdx = 0;\n        for(int x : s)\n        {\n            cord[x] = tdx;\n            ++tdx;\n        }\n        vector<int> segtree(4*tdx,-1);\n        //sorting queries according to decreasing values of x \n        for(int i = 0 ; i < m ; ++i)\n            queries[i].push_back(i);\n        sort(queries.begin(),queries.end(),compare);\n        int indx = n-1;\n        vector<int> ans(m,-1);\n        for(auto &q : queries)\n        {\n            int x = q[0];\n            int y = q[1];\n            int i = q[2];\n            while(indx >= 0 and v[indx].first >= x)\n            {\n                update(0,tdx-1,cord[v[indx].second],v[indx].first+v[indx].second,0,segtree);//(l,r,index,val,node,segtree)\n                --indx;\n            }\n            int ret = query(0,tdx-1,cord[y],tdx-1,0,segtree);//(L,R,l,r)\n            ans[i] = ret;\n        }\n        return ans;\n    }\n};\n```
['Segment Tree', 'Sorting', 'C++']