Let be the number of children whose first color is . Every child needs minutes of work, so the answer is at least .
Take any nonempty circular interval of colors, ending at color , and let children start inside it. Each of these children must use pencil . After doing so, each still has at least lines left: reaching uses at most the first colors of their sequence.
Pencil needs different minutes for these children. Its last such use cannot finish before minute , and that child needs at least more minutes. Thus the answer is at least .
Write . The bound becomes over the chosen circular interval. Let be the maximum of these sums, also allowing the empty interval with sum . We have proved that at least minutes are necessary.