TLE 1403 / 1414 passed
Intuition\nHad to use another approach.\n\n# Code\n\nclass Solution {\n    public int[] maximumSumQueries(int[] nums1, int[] nums2, int[][] queries) {\n        
# Intuition\nHad to use another approach.\n\n# Code\n```\nclass Solution {\n    public int[] maximumSumQueries(int[] nums1, int[] nums2, int[][] queries) {\n        int[] res = new int[queries.length];\n        int sum = 0, tsum = 0;\n        for(int i = 0 ; i < queries.length ; i++){\n            int x = queries[i][0];\n            int y = queries[i][1];\n            sum = 0;\n            for(int j = 0 ; j < nums1.length ; j++){\n                if(nums1[j] >= x && nums2[j] >= y){\n                    tsum = nums1[j] + nums2[j];\n                    if(tsum > sum){\n                        sum = tsum;\n                    }\n                }\n            }\n            if(sum == 0){\n                sum = -1;\n            }\n            res[i] = sum;\n        }\n        return res;\n    }\n}\n```
['Java']