C# Solution
\npublic class Solution \n{\n    private int[][] rects;\n    private int[] sums;\n    private Random random;\n\n    public Solution(int[][] rects) \n    {\n    
```\npublic class Solution \n{\n    private int[][] rects;\n    private int[] sums;\n    private Random random;\n\n    public Solution(int[][] rects) \n    {\n        this.rects = rects;\n        sums = new int[rects.Length];\n        for(int i = 0; i <rects.Length; i++)\n        {\n            var area = RectAreaPoints(rects[i]);\n            sums[i] = i == 0 ? area : sums[i - 1] + area;\n        }\n\n        random = new Random();\n    }\n    \n    public int[] Pick() \n    {\n        int index = random.Next(sums[sums.Length - 1]) + 1;\n        int left = Array.BinarySearch(sums, index);\n        if(left < 0) left = ~left;\n        int rect_index = sums[left] - index;\n        int rect_long = rects[left][2] - rects[left][0] + 1;\n        return new int[]{rects[left][0] + rect_index % rect_long, rects[left][1] + rect_index / rect_long};\n    }\n    \n    private int RectAreaPoints(int[] p)\n    {\n        return (p[2] - p[0] + 1) * (p[3] - p[1] + 1); \n    }\n}\n```
[]