Python 3 Solution (using random.randint and bisect.bisect_left)
\nimport bisect\nimport random\n\n\nclass Solution:\n\n    def __init__(self, rects: List[List[int]]):\n        self.rects = rects\n        # number of points i
```\nimport bisect\nimport random\n\n\nclass Solution:\n\n    def __init__(self, rects: List[List[int]]):\n        self.rects = rects\n        # number of points in each rectangle\n        self.counts = [(x2 - x1 + 1) * (y2 - y1 + 1) \n                       for x1, y1, x2, y2 in rects]\n        self.total = sum(self.counts)\n        # accumulated (prefix) count of points\n        self.accumulate_counts = []\n        accumulated = 0\n        for count in self.counts:\n            accumulated += count\n            self.accumulate_counts.append(accumulated)\n\n    def pick(self) -> List[int]:\n        # rand is in [1, n], including both ends\n        rand = random.randint(1, self.total)\n        # find rightmost index with value <= rand\n        # e.g., for accumulate_count of [2, 5, 8], with rand inputs range [1, 8]\n        # there are 3 groups {1,2 | 3,4,5 | 6,7,8}, corresponding to index [0, 1, 2] respectively\n        rect_index = bisect.bisect_left(self.accumulate_counts, rand)\n        # use rand to find point_index, too\n        point_index = rand - self.accumulate_counts[rect_index] + self.counts[rect_index] - 1\n        x1, y1, x2, y2 = self.rects[rect_index]\n        i, j = divmod(point_index, y2 - y1 + 1)\n        return [x1 + i, y1 + j]\n```
[]