BEATS 100%.
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. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution(object):\n    def maximumBeauty(self, items, queries):\n        \n        maxI = float(\'inf\')\n        res = [[0, 0, maxI]]\n    \n        items.sort(key=lambda x: x[0])\n\n        for price, beauty in items:\n            lastBracket = res[-1]\n            if beauty > lastBracket[1]:\n                res[-1][2] = price\n                res.append([price, beauty, maxI])\n\n        ans = []\n\n        for x in queries:\n            for i in range(len(res) - 1, -1, -1):\n                if res[i][0] <= x:\n                    ans.append(res[i][1])\n                    break\n\n        return ans\n```
['Python3']