Yey
\n# Code\n\nfunction findIndex(arr, value) {\n    let left = 0;\n    let right = arr.length;\n    \n    while (left < right) {\n        const index = Math.floor
\n# Code\n```\nfunction findIndex(arr, value) {\n    let left = 0;\n    let right = arr.length;\n    \n    while (left < right) {\n        const index = Math.floor((right + left) / 2);\n\n        if (arr[index] > value) {\n            right = index;\n        } else {\n            left = index + 1;\n        }\n    }\n    return left;\n}\n\n/**\n * @param {number[][]} queries\n * @return {boolean[]}\n */\nvar getResults = function (queries) {\n    const blocks = [0];\n    const gaps = [0];\n    const result = [];\n\n    for (let qi = 0; qi < queries.length; qi += 1) {\n        const query = queries[qi];\n        if (query[0] === 1) {\n            const value = query[1];\n            const index = findIndex(blocks, value);\n\n            if (index === blocks.length) {\n                const delta = Math.max(gaps[index - 1], value - blocks[index - 1])\n                gaps.push(delta);\n                blocks.splice(index, 0, value);\n            } else {\n                const oldDelta = blocks[index] - blocks[index - 1];\n                blocks.splice(index, 0, value);\n\n                if (oldDelta < gaps[index]) {\n                    gaps.splice(index, 0, gaps[index]);\n                } else {\n                    const before = gaps[index - 1];\n                    const delta1 = value - blocks[index - 1];\n                    const delta2 = blocks[index] - value;\n                    let nextDelta = Math.max(delta1, delta2);\n\n                    if (delta1 > gaps[index - 1]) {\n                        gaps.splice(index, 1, delta1, nextDelta);\n                    } else {\n                        gaps.splice(index, 0, Math.max(gaps[index - 1], nextDelta))\n                    }\n\n                    let max = gaps[index];\n                    for (let i = index + 1; i < gaps.length && max < oldDelta; i += 1) {\n                        max = Math.max(gaps[i - 1], blocks[i] - blocks[i - 1]);\n                        gaps[i] = max;\n                    }\n                }\n            }\n        } else if (query[0] === 2) {\n            let find = false;\n\n            const i = findIndex(blocks, query[1]);\n            if (i >= gaps.length || (blocks[i] > query[1] && gaps[i - 1] < query[2])) {\n                const value = Math.max(query[1] - blocks[i - 1], gaps[i - 1]);\n                result.push(value >= query[2]);\n            } else {\n                result.push(gaps[i] >= query[2]);\n            }\n        }\n    }\n    return result;\n};\n```
['JavaScript']