Layered Coating
A workshop applies a coating to a long metal bar. The bar has N marked regions. Region i is the closed interval [si,ei] with integer endpoints. Any two regions are either nested, meaning one contains the other, or are treated as disjoint. In particular, regions that share only one endpoint, such as [1,4] and [4,7], are treated as disjoint.