C++ beat 99%
cpp\nclass Solution {\npublic:\n    vector<vector<int>> data;\n    int area = 0;\n    \n    Solution(vector<vector<int>>& rects) {\n        for (auto& x : rects
```cpp\nclass Solution {\npublic:\n    vector<vector<int>> data;\n    int area = 0;\n    \n    Solution(vector<vector<int>>& rects) {\n        for (auto& x : rects) {\n            area += (x[2] - x[0] + 1) * (x[3] - x[1] + 1);\n            data.push_back({area, x[0], x[2] - x[0] + 1, x[1], x[3] - x[1] + 1});\n        }\n    }\n    \n    vector<int> pick() {\n        int num = rand() % area;\n        int l = 0, r = data.size() - 1;\n        while (l < r) {\n            int m = l + (r - l) / 2;\n            if (data[m][0] < num) l = m + 1;\n            else r = m;\n        }\n        \n        if (data[l][0] == num && l != data.size() - 1) ++l;\n        \n        vector<int>& y = data[l];\n        \n        return {rand() % y[2] + y[1], rand() % y[4] + y[3]};\n    }\n};\n```
[]