You are given an empty square grid. Each cell can be an island with a positive integer $n$ or a bridge connecting islands. The following rules apply:
- Each island with a number $n$ must have exactly $n$ bridges attached to it
- Bridges must be either horizontal or vertical with one or more cells in length
- Bridges cannot intersect, but they can meet at an island
- All islands must be connected into a single component
For example, here is a valid arrangement for islands with numbers 1 to 4:
Can you find an arrangement for islands with numbers 1 to 12? Bonus: what is the smallest rectangle (by area) that can fit such an arrangement?