[Python] Binary Search
Explanation\ncount(x) returns the sum of bits from 1 to x.\nmul(x) returns the pow of product of powerful arrays from 1 to x.\nquery(k) returns the pow of produ
# **Explanation**\n`count(x)` returns the sum of bits from `1` to `x`.\n`mul(x)` returns the pow of product of powerful arrays from `1` to `x`.\n`query(k)` returns the pow of product of `k` first integers in `big_nums`.\n<br>\n\n# **Complexity**\nTime `O(Q * logR * logR)`\nSpace `O(Q + logR)`\n<br>\n\n\n**Python**\n```py\n    def findProductsOfElements(self, queries: List[List[int]]) -> List[int]:\n        def count(x):\n            if x == 0:\n                return 0\n            b = x.bit_length() - 1\n            v = 1 << b\n            res = b * (v >> 1)\n            return res + count(x - v) + x - v\n\n        def mul(x):\n            if x == 0:\n                return 0\n            b = x.bit_length() - 1\n            v = 1 << b\n            res = (b - 1) * b * v >> 2\n            return res + mul(x - v) + b * (x - v)\n\n        def query(k):\n            if k == 0:\n                return 0\n            k += 1\n            x = bisect_left(range(1, 10 ** 15), k, key=count)\n            res = mul(x)\n            k -= count(x)\n            for _ in range(k):\n                b = x & -x\n                res += b.bit_length() - 1\n                x -= b\n            return res\n\n        return [pow(2, query(j) - query(i - 1), mod) for i, j, mod in queries]\n```\n
[]