Pregunta de entrevista de Casella Waste Systems

Simple algorithm problem involving a supply chain.