Initial poor solution
Complete solution for overlapping rectangles