Sweep a vertical line from left to right. At each event:
Rectangle start (left edge): add its -interval to active set
Rectangle end (right edge): remove its -interval from active set Between consecutive events, the covered area is: (distance to next event) (total covered -length). Use a segment tree with lazy propagation to track the covered -length as intervals are added/removed. Time: . Space: .