Probably, shortest and easiest python solution. [please upvote please]
\nclass Solution:\n    def maximumSumQueries(self, nums1: List[int], nums2: List[int], queries: List[List[int]]) -> List[int]:\n        # Combine nums1 and nums
```\nclass Solution:\n    def maximumSumQueries(self, nums1: List[int], nums2: List[int], queries: List[List[int]]) -> List[int]:\n        # Combine nums1 and nums2 into pairs and sort them in descending order based on nums1\n        sp = list(zip(nums1, nums2))\n        sp.sort(reverse = True) \n\n        py = -1\n        # Initialize arrays to hold new values of nums1 and nums2 and sums of the pairs\n        nx = []\n        ny = []\n        sl = []\n\n        # For each pair, if the second element is greater than py (initially set to -1),\n        # then update py, append the sum of the pair to sl and append the elements of the pair to nx and ny\n        for x, y in sp:\n            if y > py:\n                py = y\n                sl.append(x + y)\n                nx.append(x)\n                ny.append(y)\n\n        # Reverse the order of nx, since the pairs were sorted in descending order initially\n        nx = nx[::-1]\n        nn = len(sl)\n        res = []\n\n        # For each query, find the range of indices in nx and ny that satisfy the query\n        # Then, append the maximum sum in the range to res\n        # If there are no sums in the range, append -1\n        for x, y in queries:\n            xp = nn - bisect.bisect_left(nx, x)\n            yp = bisect.bisect_left(ny, y)\n            if sl[yp:xp]:\n                res.append(max(sl[yp:xp]))\n            else:\n                res.append(-1)\n                \n        return res\n```
['Python', 'Python3']