Go
\ntype Solution struct {\n    list []rec\n    sum int\n}\n\ntype rec struct {\n    bottomleft [2]int\n    l int\n    w int\n    prefixPoints int\n}\n\nfunc Cons
```\ntype Solution struct {\n    list []rec\n    sum int\n}\n\ntype rec struct {\n    bottomleft [2]int\n    l int\n    w int\n    prefixPoints int\n}\n\nfunc Constructor(rects [][]int) Solution {\n    list := make([]rec, len(rects))\n    sum := 0\n    for i, v := range rects {\n        a, b := v[2] - v[0] + 1, v[3] - v[1] + 1\n        list[i] = rec{bottomleft: [2]int{v[0], v[1]},\n                      l: a,\n                      w: b,\n                      prefixPoints: sum + a * b}\n        sum += a * b\n    }\n    return Solution{list: list,\n                    sum: sum}\n}\n\n\nfunc (this *Solution) Pick() []int {\n    tar := rand.Intn(this.sum + 1)\n    index := sort.Search(len(this.list), func(i int) bool {\n        return this.list[i].prefixPoints >= tar\n    })\n    l := this.list[index].l\n    w := this.list[index].w\n    return []int{rand.Intn(l) + this.list[index].bottomleft[0], \n                rand.Intn(w) + this.list[index].bottomleft[1],\n                }\n}\n```
[]