JS
Code\n\n/**\n * @param {number[][]} queries\n * @return {boolean[]}\n */\nvar getResults = function (queries) {\n    let main = [];\n    let larg = [];\n    let
# Code\n```\n/**\n * @param {number[][]} queries\n * @return {boolean[]}\n */\nvar getResults = function (queries) {\n    let main = [];\n    let larg = [];\n    let ans = [];\n\n    for (const q of queries) {\n        if (q[0] === 1) {\n            let ind = bisect(main, q[1]);\n\n            if (ind === 0) {\n                main.splice(0, 0, q[1]);\n                larg.splice(0, 0, q[1]);\n            } else {\n                main.splice(ind, 0, q[1]);\n                larg.splice(ind, 0, Math.max(larg[ind - 1], (main[ind] - main[ind - 1])));\n            }\n\n            ind += 1;\n\n            while (ind < main.length) {\n                if (larg[ind] === larg[ind - 1]) {\n                    break;\n                }\n                larg[ind] = Math.max(larg[ind - 1], (main[ind] - main[ind - 1]));\n                ind += 1;\n            }\n        } else {\n            if (q[2] > q[1]) {\n                ans.push(false);\n            } else {\n                let ind = bisect(main, q[1]);\n                let lim;\n\n                if (ind === 0) {\n                    lim = q[1];\n                } else if (main[ind - 1] === q[1]) {\n                    lim = larg[ind - 1];\n                } else {\n                    lim = Math.max(larg[ind - 1], (q[1] - main[ind - 1]));\n                }\n\n                ans.push(q[2] <= lim);\n            }\n        }\n    }\n\n    return ans;\n};\n\n// Helper function to simulate bisect_left from Python\'s bisect module\nfunction bisect(arr, x) {\n    let left = 0;\n    let right = arr.length;\n\n    while (left < right) {\n        let mid = Math.floor((left + right) / 2);\n\n        if (arr[mid] < x) {\n            left = mid + 1;\n        } else {\n            right = mid;\n        }\n    }\n\n    return left;\n}\n\n```
['JavaScript']